- Home /
Help! Enabling/Disabling colliders during animation doesn't work!
I want to have an attack animation for my character. I have a child gameobject called sword, and sword has a circle collider. I want to enable this circle collider only on specific frames of my attack animation, so I enable and disable the collider as a part of the animation.
Everything works fine, in the animation preview window, however when I inspect the scene when the game is running, I see the collider is always enabled throughout the whole attack animation. The default state of the collider is disabled, and the collider is a trigger. I'm pretty sure no other code messes with the collider other than the animation itself. Is this behavior normal?
Answer by ovunctuzel · Mar 09, 2018 at 09:13 PM
SOLVED: Apparently the collider value should be the same at the first and last frame of the animation.
Your answer
Follow this Question
Related Questions
How to Make a Bat Hit a Ball and the ball gets some velocity and goes fast . 0 Answers
Animating 2D colliders not recording frame 0 Answers
2D Sprite, Animation Question 1 Answer
Player Hit Physics implementation using 2D Animation Frames 0 Answers
How can I change a polygon collider in a Animation? 1 Answer