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

No animation on player movement 3d

Discussion in 'Scripting' started by Sabroan, Apr 20, 2015.

  1. Sabroan

    Sabroan

    Joined:
    Apr 8, 2015
    Posts:
    13
    I am working on a 3d game and I want to create slot movement system where player can move on left, midle and right side, It's working fine but the problem is with my code player is just "teleported" to desired position, no animation at all.
    My code is:

    transform.position += new Vector3(-1.31f,0,0);


    My question is: How can I achieve smooth movement animation?
     
  2. Sydious

    Sydious

    Joined:
    Apr 1, 2010
    Posts:
    172
    Sabroan likes this.
  3. Sabroan

    Sabroan

    Joined:
    Apr 8, 2015
    Posts:
    13
    Yeah, LERP Is what I need, thanks!