- Home /
How to animate collider along with object for 2D game?
I have a polygon collider attached to my player. I am using animations on my player. While playing, collider is moving with player that is fine but it is not being animated according to character. I also tried checking ANIMATE PHYSICS check box under animator component but it is not working.
any help will be appreciated. Thanks in advance.
Answer by ado112 · Jun 27, 2014 at 10:12 AM
Mesh colliders are not very well suited for complex, moving meshes.I suggest you to use some primitive colliders like cubes,spheres,capsules.if your character is human then you can put capsule collider on it.
thanks for your response #addo112. I want to tell you that i am developing 2D game and i am applying 2D Polygon collider to my player. When my player changes its position,collider also changes with it but problem is that COLLIDER is not shaping it self(a.k.a ANI$$anonymous$$ATING) itself with player animation. Is there any way to do this? and please also tell that for what the option 'ANI$$anonymous$$ATE PHYSICS' is used in 2D games? THAN$$anonymous$$S :)
http://docs.unity3d.com/ScriptReference/Animation-animatePhysics.html - little about animate physics. Animate physics does not make your collider animated. How did you animated your mesh(animation software or unity)? Can you post a picture of your object? You mean that collider is not following object like here:
Your answer
Follow this Question
Related Questions
SpriteManager 2 1 Answer
Raycasting colliders moved by Mechanim animation? 0 Answers
Authoritative Networking 2D Movement 0 Answers
Unity Animation Causes Clipping 0 Answers
How to play and stop animation via code in Unity4.3 for 2D objects. 0 Answers