#Help please! i still don't know why the power ups are not working
60 messages · Page 1 of 1 (latest)
Just so I don't have to look through the code, where do you keep the power up code?
Like, in which script?
You seem to be going through the vboxcontainer instead of the label, is this intended?
This is the set up i have seen online for menu's
Is this what you were asking?
Are you doing this through a tutorial perchance?
it was a totally diffrent menu tutorial so i can't go back to it for this project
i could not find a tutorial on this power up mechanic'
Are you writing the code yourself for the power up menu I mean
no,they were from tuts and ai
Okay, thanks
So the problem here is
In the code you are accessing the wrong node
See the for loop?
For button in bla bla bla
yeah
It goes through this little thing until it reaches vboxcontainer
And it looks for everything inside that
But it's only detecting the label
oh damn
And the buttons it's supposed to detect is in the label
So to fix this you extend the path to the label
$PanelContainer/Panel/VBoxContainer/Label.get_children()
now i get this error
Invalid assignment of property or key 'pause_mode' with value of type 'int' on a base object of type 'Button'.
func _ready():
for button in $PanelContainer/Panel/VBoxContainer/Label.get_children():
if button is Button:
button.pause_mode = 2 # PROCESS mode manually set
button.pressed.connect(_on_button_pressed.bind(button.text))
There is the problem, does the game not let you move when this error appears? It shouldn't if it's a runtime error
whole project is gray
Yeah
Can you screenshot the inspector of the buttons?
Wait nevermind
Yeah do it
Yeah not sure what pause mode is supposed to be
Are you sure you followed the tutorial fully?
ITS WORKING!
i removed button.pause_mode = 2
and made a refrence for the fire cooldown
but now another problem..
Yeah?
increasing the fire rate just makes another pistor in the middle of the screen
for whatever reason
Pistol?
This video provides everything
all the codes and nodes
ITS FIXED!!
now this is cool
I had to reference the pistol in the player script
Thank you Felix
You kinda fixed this yourself, lol
Well you did point me to the fix lol
You're welcome then
"not sure what paused mode is" and "pistol?" made me look them up
It's cus you said Pistor 😭
Shhhiittt time to add a piss pistol