Search Unity

can't make my character move

Discussion in 'Getting Started' started by kasmurdanto, Jun 10, 2019.

  1. kasmurdanto

    kasmurdanto

    Joined:
    Jun 6, 2019
    Posts:
    10
    so I'm starting with Unity , I followed the john lemon tutorial , and I wanted to apply what I learn on a model on my own coming from blender. Everythings works , animation , rotation , but not translation . For some reasons my character doesn't move at all . It might have to do something with root motion since I have apply root motion in grey with written just after "handled by script" . Not sure what to do .. I found something about character in place, I think I'm in this case but I'm not sure how to use it in my script .. https://docs.unity3d.com/Manual/ScriptingRootMotion.html

    If you ask I'll give you my project .
     
  2. kasmurdanto

    kasmurdanto

    Joined:
    Jun 6, 2019
    Posts:
    10
    ok so I made some advances :
    Code (CSharp):
    1.     void OnAnimatorMove()
    2.     {
    3.             m_Rigidbody.MovePosition(m_Rigidbody.position + m_Movement * m_Animator.deltaPosition.magnitude * 10000);
    4.             m_Rigidbody.MoveRotation(m_Rotation);
    5.             Debug.Log("m_Animator.deltaPosition.magnitude: " + m_Animator.deltaPosition.magnitude);
    6.  
    7.     }
    m_Animator.deltaPosition.magnitude is actually always equal to 0 , explaining why my charachter doesn't translate but why is it always equal to zero ?
     
  3. Penny_Lu

    Penny_Lu

    Joined:
    Oct 28, 2019
    Posts:
    12
    I have the same problem...Have you solved it?