Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

can't make my character move

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

  1. kasmurdanto

    kasmurdanto

    Joined:
    Jun 6, 2019
    Posts:
    9
    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:
    9
    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?