- Home /
The question is answered, right answer was accepted
How to get root motion relative (not absolute)
I have a character that uses the animations from the mecanim tutorial as controls. However, I made a script which reorients the character so they have the ability to walk on walls. However, the root motion for go forward works, but the turning no longer works.
So I have two questions: 1) does the fact that the forward motion works show that it is my 'wall walkin' script that is wrong? 2) If so should I use a mix between mecanim and character control scripts? 3)Do root motions transfer when the character is reoriented?
Thanks in advance!
transform.rotation = Quaternion.FromToRotation(initial_vector,surface_normal_vector);
Answer by nocoast · Sep 22, 2013 at 03:05 AM
Vector3 new_forward = Vector3.Cross( centv, transform.right ); gameObject.transform.rotation = Quaternion.LookRotation( -new_forward, centv );
This did the trick!