0 votes

I am attempting to use a timer to alter a variable in the parent node of the timer, the player.

func _on_DashTimer_timeout():
get_node("root/Game/Level_1/Player").ACCELERATION = 10
get_node("root/Game/Level_1/Player").MAX_SPEED = 50
get_node("root/Game/Level_1/Player").velocity = get_node("Player").current_velocity

however, whenever I run it, it says "invalid set index 'ACCELERATION' (on base: null instance) with value of 'int'"

I haven't spelled it wrong or anything, so I'm not sure what's going on. Anyone know the solution?

Godot version 3.5.1
in Engine by (14 points)

1 Answer

+1 vote

Change the paths to "/root/Game/Level_1/Player"

by (1,053 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.