Skip to main content
2 of 3
fixing indent
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Can't change a variable within parent node using a timer

I am trying to use a timer to change a variable in the parent node of the timer upon timeout.

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("root/Game/Level_1/Player").current_velocity

However, when I attempt to run it, it comes up with the error "Invalid set index 'ACCELERATION' (on base: null instance) with value of type 'int'"

Anyone know how to fix this?