Search Unity

Animation clip is locking FPC camera rotation

Discussion in 'Animation' started by LSC17, Apr 10, 2018.

  1. LSC17

    LSC17

    Joined:
    Aug 4, 2017
    Posts:
    6
    hey all, still pretty new to unity, I'm using the standard assets FPC character prefab, and I used mecanim to animate the player to crouch up and down in 2 states, with a blank idle to hold in between.

    With 2 trigger words of Play and Stop to go back and forth. All trigger words get called with playmaker.

    The issue I dont understand is when I added a 3rd clip to animate the camera falling over (player dying/death) to only be called via a 3rd trigger word (which I realize below the transition for death should actually be on Any State, my mistake, nvm that), the player cameras vertical rotation is then locked during gameplay... :/ even though mecanim is only on "Idle" at the time.

    Why this is the camera locking up? how do I avoid this conflict?

    many thanks

    testing-1.png
     
  2. Mokzen

    Mokzen

    Joined:
    Oct 10, 2016
    Posts:
    102
    I second this question, I have the same issue.
     
  3. LSC17

    LSC17

    Joined:
    Aug 4, 2017
    Posts:
    6
    Yeah I've seen similar posts about it but I haven't quite grasped what the fix/working method is, something to do with where to add the animation controller and hierarchy of empty game objects to put animation controller on etc.

    And it's near impossible to google this because wording this specific issue is very difficult
     
  4. Mokzen

    Mokzen

    Joined:
    Oct 10, 2016
    Posts:
    102
    Indeed. I started this thread with a video:
    https://forum.unity.com/threads/animation-locked-camera-rotation-now-with-video.526292/#post-3458355

    Same issue as yours?
     
  5. LSC17

    LSC17

    Joined:
    Aug 4, 2017
    Posts:
    6
    Yeah looks the same as mine, i can rotate horizontal but not vertical, it seems that if another animation clip has camera rotation added to it, then it freezes that object, even when in idle state which makes no sense at all, im stumped
     
  6. Mokzen

    Mokzen

    Joined:
    Oct 10, 2016
    Posts:
    102
    I've had the same thought. My idle animation, which doesn't even have any movement parameters, is somehow locking the cameras rotation. It's weird.
     
  7. Mokzen

    Mokzen

    Joined:
    Oct 10, 2016
    Posts:
    102
    @LSC17

    I found a workaround for this issue. I made the FirstPersonCharacter object a child of an empty GameObject, which I then animated instead of the actual FirstPersonCharacter object. It works fine for me now.

    Apparently Unity doesn't like animating the FirstPersonCharacer object if that's where your main camera is located.
     
    LSC17 likes this.
  8. LSC17

    LSC17

    Joined:
    Aug 4, 2017
    Posts:
    6
    Yeah it seems to boil down to needing to use the animator on empty parents, kind of annoying though