- Home /
Problem with collision detection during animation
Hello, I created an animated GameObject that is moving up and down. When the player object is positioned below this animated object and is not moving, the OnCollisionEnter-method is not called. The player has a rigidbody component attached to him and both objects have colliders. I have already set animatePhysics to true for the animation.
What can I do to fix this?
Answer by Seth-Bergman · Aug 06, 2012 at 12:16 PM
If the player is not moving, his rigidBody may be asleep, in which case a static collider (one without a rigidbody) won't wake it..
you can add a rigidbody to the other object, this will make it work I think
or I guess changing the sleep velocity of the rigidbody to 0 should work too
Thanks for the quick answer. Changing the sleepVelocity worked fine.
Your answer
Follow this Question
Related Questions
Animation causes rigidbody to move 0 Answers
Instantiated Bullet Lags Behind Animated Timeline Object 1 Answer
How do you move a character with physics when using Animator.setInteger to play the animations? 0 Answers
Character faces wrong way for one frame only. Why? 1 Answer
i want to make an animation throw code 0 Answers