3
\$\begingroup\$

I've been creating an infinite runner game in Unity3D for a while and I got stuck in this point that whenever my character jumps using Mecanim system his model (mesh) goes to air but his attached collider does not.

For jumping I don't apply any force or somethings else. (He does not even have a rigid body component). The jumping process is only done by Mecanim animation jump.

Is there any way to make that collider to move along with the model?

Please note that since I've used character controller to controlling my character, I cannot use "Apply root motion".

\$\endgroup\$
1
\$\begingroup\$

In animation mesh does not get animated, its the bones which animate and the mesh are deformed or placed according to the bones and skinning information. So the simplest way is to attach the collider to one of its root bone. By trial and error you will find out which bone suits best for your needs :)

\$\endgroup\$
0
\$\begingroup\$

Another option would be to use animation curves. You can learn more about them here, as I am not entirely familiar with them.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.