- Home /
How to respect colliders in Animations with Root Motion ?
Hello everyone,
I have a Problem with animations and Motion, in my game there are enemies following the Player, and the have a walk Animation. I applied root Motion so the movement Comes from the Animation itself. Now, after running around some the enemies overlap somehow and I dont know how to fix this. They all have colliders and normally should not be able to overlap, is it possible to make the animations respect the colliders ?
Thank you alot , AgeT
Noone can help ? Here are some screenshots of my Problem :
As you can see, the colliders are not respected. The zimbies just move through each other or as seen in the first Picture walk through a box.
What am i Doing wrong ?
Answer by MrSteve1 · Aug 13, 2014 at 05:31 PM
Would you would need is a script that restricted the speed of the enemy when it comes into contact with another object tagged "Enemy" for example.
I would check this video out, this dude helped me out a bunch https://www.youtube.com/watch?v=0nQnbxCiWWE∈dex=37&list=PL7AE076AFAFD3C305
Hope this helps!
But why aren't they just colliding and pushing each other away, or in the boxes case , $$anonymous$$eep them outside the box ?
Because your script that is telling them to follow the player at all costs is essentially overriding any collision info and just placing the enemies where they need to be, thus crushing them all together.
Enemy AI is a $$anonymous$$efield.
Hm yeah that is what I was thinking too, but I am not using a Script to move them, I use the Root $$anonymous$$otion provided by the $$anonymous$$ecanim Animation , and my script is only changing the Zombies direction they look at. So infact, Animations override colliders ?