Skip to main content
Make root problem more visible in the title.
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Can't change a variable within parent node using a timer "Invalid set index (on base: null instance)" error

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'"

Invalid set index 'ACCELERATION' (on base: null instance) with value of type 'int'

Anyone know how to fix this?

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?

"Invalid set index (on base: null instance)" error

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?

fixing indent
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

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?

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?

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?

Source Link

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?