0
\$\begingroup\$

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?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ "null instance" sounds like a problem. Are you sure the "root/Game/Level_1/Player" node is being found? \$\endgroup\$
    – DMGregory
    Oct 17, 2022 at 23:42
  • \$\begingroup\$ You can accept your own answer. And doing so, you signal that this is resolved. \$\endgroup\$
    – Theraot
    Oct 25, 2022 at 5:52

1 Answer 1

2
\$\begingroup\$

I realized I had to add a / before root. Hope this helps someone else who has this problem.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .