All Questions


yousef bohadi
posted to: Firing the Hook

Invalid get index 'cooldown'

After compiling the code up to this point, when I run the game I get the following error: Invalid get index 'cooldown' (on base: 'position2D('). the error also points to the enter() function in the

func enter(msg: Dictionary = {}) -> void: owner.cooldown.connect("timeout", self, "_on_Cooldown_timeout") owner.cooldown.start()
  • Nathan Lovato replied

    You're trying to access a variable called `cooldown` on the `owner`, in this case, the `Hook` node. Check `cooldown` is either not defined, or more likely, there is a typo. You should have a line that looks like that in

    onready var cooldown: Timer = $Cooldown