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

How can i make Car wheel animaiton?

Discussion in 'Animation' started by sharpg, Jul 1, 2015.

  1. sharpg

    sharpg

    Joined:
    Mar 10, 2015
    Posts:
    150
    Dear all,I am trying to make car wheel rotate animation.Wheel rotates but after completing one rotation it gets a jerk.Please help me how can i make a smooth car wheel rotate animation?Thanks.
     
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    You should probably show us what you've got now (the code that makes the wheel rotate) so we can indicate what is wrong.

    A very simple way to make something rotate is to do something like:

    Code (csharp):
    1. void Update()
    2. {
    3.     transform.Rotate(Vector3.forward * Time.deltaTime * 100);
    4. }
    Obviously change Vector3.forward to the correct axis for your wheel and the 100 to something to get the right speed.

    If you're using physics then you should rely on physics to do the rotation, but it sounds like you're not using physics so....
     
    Last edited: Jul 1, 2015
    sharpg likes this.
  3. sharpg

    sharpg

    Joined:
    Mar 10, 2015
    Posts:
    150
    Thanks Sir, now its working fine for me :).
     
    Last edited: Jul 1, 2015