Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Godot_Questions |
I am trying to turn off my Player child node area2D Hurtbox via function to make the player invincible. The function call is triggered by an animation which calls it on a frame.
On my Player.gd:
onready var hurtbox = $Hurtbox
func roll_invincibility_started():
hurtbox.set_deferred("monitoring", false)
I have tried a few things instead of hurtbox.set_deferred such as
get_node("Hurtbox").monitoring == false
How can I do it?
code is incorporated correctly. Make sure your ANimationPlayer calls this function using print
Inces | 2022-09-04 18:27
Kindly, could you show a code snippet of which is correct? get_node or my first snippet?
Regarding having AnimationPlayer call the function using print
, you have lost me there. I have set it up as a call method track on the animation player so that the function would be called on a specific frame.
Godot_Questions | 2022-09-04 18:38