Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animator/Animation simple position offset issue

Discussion in 'Animation' started by Alexaroth, Jun 7, 2020.

  1. Alexaroth

    Alexaroth

    Joined:
    Feb 4, 2019
    Posts:
    29
    Very simple setup:

    Tower-defence like turret prefab, with up to 3 barrels. Starts with 1 barrel, each upgrade enables an extra barrel, up to 3.

    I have an animator on the prefab that controls idle anims (barrels hover up and down.)

    Level1:

    upload_2020-6-7_17-56-18.png

    The barrel will hover up and down.


    Level 2:

    2 barrels moving up and down:

    upload_2020-6-7_17-57-7.png


    Animation:

    upload_2020-6-7_17-57-46.png

    Issue is that when upgrading from level 1 to level 2, and doing the transition between anims, the first barrel stays in the centre, and moves up and down:

    upload_2020-6-7_18-0-25.png

    I don't understand why the first barrel doesnt pop in the position it has in the animation keyframes. The second barrel is hidden and enabled when upgrading but its already in its correct position. If I were to have it by default in the center, it will also be in the center when upgrading to level 2.

    I think this might be an issue with local/global anim offsets but I cannot figure out what exactly.

    Notice the X for barrel1 in animation 2 doesn't change, and is -0.25 (placing it to the side from the center). This essentially gets squashed by the animator for some reason. If I were to have it so that X varies from 0 to 10 across that animation, it executes correctly, but if I do it to vary between 5 and 10, it stomps the first 5 and just does a 0-5 animation. It's like the animator operates on deltas between keyframes only.

    Any help would be greatly appreciated!
     
    Last edited: Jun 7, 2020
  2. Alexaroth

    Alexaroth

    Joined:
    Feb 4, 2019
    Posts:
    29
    Think I found the solution. Changed the blending for the layer from additive to override. Having looked at the documentation for that particular setting, I still don't understand why it would result in the above behaviour