0 votes

I'm trying to disable the collision detection when my enemy goes into a specific state.
Example:
Disabling -
func onArea2Dbodyentered(body):
emitsignal("Bounce")
State = 1
if Timer.is
stopped() and BackOut.isstopped():
AnimationPlayer.play("ShellStill")
Timer.start()
HitBox.set
disabled(true)
Enabling -
func onbackOut():
AnimationPlayer.play("Walk")
TimerState = false
State = 0
HitBox.set
disabled(true)

asked May 10 in Engine by GreenDiggy (16 points)

1 Answer

0 votes

Assuming HitBox is a valid reference to your CollisionShape2D, try this instead...

HitBox.set_deferred("disabled", true)
answered May 10 by jgodfrey (5,596 points)

Okay thanks so much! It worked

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.