Search Unity

Clamp property using Animation

Discussion in 'Animation' started by U7Games, Nov 15, 2018.

  1. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    i have an animation (using Mecanim) that animates the emission color of an object mesh renderer, when reach the last frame of the object and when it finished playing the animation, the color property returns to default gray (this is the common behavior), what i need is to register the new color after the animation reaches the end...

    Example:

    Animation interval from Gray to Red
    Animation length is 1 second.

    I play Animation through scripting using Trigger Mecanim parameter, the animation plays and reaches the end, at frame 60, my object is fully red painted, then animation stop, and want to keep as red, then play an Idle animation but with Red emission color information active....

    I think i cant use Clamp Mode since i need to change to Idle.

    Any way to make it?
    Thanks.
     
  2. leftshoe18

    leftshoe18

    Joined:
    Jul 29, 2017
    Posts:
    61
    You could achieve this using animation layers. Place the color change animation on a separate layer from the actual movements. You may need to mess around with layer weights and additive vs override modes for the layer.
     
    U7Games likes this.