Search Unity

Question Rotation appears to be frozen

Discussion in 'Scripting' started by kayeNReXzO, Aug 1, 2020.

  1. kayeNReXzO

    kayeNReXzO

    Joined:
    Jul 12, 2020
    Posts:
    2
    Hi,
    I am quite new to Unity and currently trying tio make a little 3D Game. However, I am facing a problem, that I couldn't solve and there seemingly isn't any solution provided by the internet.

    When the player performes a certain action, I want the right wrist to rotate slightly using Quaternion.Euler, which works fine on a lot of other things that are also in the game.
    But the wrist does not rotate at all, I have tried out changing the other transform components and the position does not change either, only the scale was changable with code.
    To see if it was a code mistake, I tested changing the rotation manually in the game preview, but this didn't work as well, it was reset straight away.

    Does anyone here know how to fix such a problem?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    I'm assuming you have an Animator/Animation on your character. The animator overrides any changes you make in Update. Usually the way to get around this is to do the changes in LateUpdate(), which supposedly works for some reason that I don't fully understand.
     
  3. kayeNReXzO

    kayeNReXzO

    Joined:
    Jul 12, 2020
    Posts:
    2
    Yes, that was the exact problem, I already fixed it, but thank you for your awnser anyways.
    If you are interested to hear that, I avoided the problem by simply disabling the animator whenever the player holds the specific Item.