0 votes

I have a sprite, collisionshape2D and an animation player. The purpose is: The sprite enters an Area2D and collision triggers inside the Area2D once.

I changed the shape of the collisionshape2D during my animation so that it follows the sprite animation. However, during the collision, the collision registers each time the sprite animation changes. This makes an unnecessary repetition of collisions. How do I put a delay in my Collisionshape2D after each hit so that it only registers once in certain amount of time?

I've tried using the timer node, but it does not work.

Thanks in advance.

in Engine by (14 points)

1 Answer

0 votes

collision triggers inside the Area2D once

You could disable the Area2D's collisionshape in the body_entered signal.
The physics engine will keep registering entering collisions as the collisionshape itself is altered, I don't know the full nitty-gritty of why this is but it's unavoidable and it doesn't only happen in Godot either.

by (3,259 points)
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.