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. Dismiss Notice

Question Object with Animator rotates randomly

Discussion in 'Animation' started by Nico02myself, Jul 20, 2023.

  1. Nico02myself

    Nico02myself

    Joined:
    May 19, 2019
    Posts:
    1
    Hello,
    I'm very new to Unity and trying to do something outside of a tutorial. I use animator for an idle and a jump animation. The idle animation does nothing, the keyframe for the position is the same in the beginning and at the end. I also tried it with no keyframes at all.

    When I start the game and wait for 2-3 seconds, the player (a simple rectangle) randomly starts rotating and I don't know why. The "Apply root motion" Button is unchecked and other than that I found nothing on the internet that could help.

    If someone has an idea as to why and how to fix it, I would be really greatful.
     
  2. Gordon_G

    Gordon_G

    Joined:
    Jun 4, 2013
    Posts:
    358
    You need to track down the source of the rotation. If you have animation clips then look through those and to see if you affect the objects rotation in any of the keyframes. If that is not the source, then you must have a script doing the rotation.

    What is your goal - you want it to rotate in response to input?

    Take some screen shots of how you have set up your animator with the idle and other clips, and some of each animation clip's window where you see the key frames. Post them here. It helps us help you!