Search Unity

Enable/Disable Sprite renderer as a part of Animation (*.anim track)

Discussion in 'Animation' started by DimitriX89, Mar 15, 2018.

  1. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    I wanted to ask if enabling/disabling renderers from animation track has some limitations I dont know about. The problem is following: I was working on a special effect system (for things like muzzle flashes). The idea was to put everything that is happening to the "effect" object (including visibility switching) to the animation track. Then I would manipulate the Cycle Offset of this animation from script to both show/hide the object and animate it. But for some reason, turning Sprite renderer on/off does not work with such setup. Other keyframes (such as Scale) play as intended, but if I try to keyframe the renderer, it stays at its first frame state (Disabled in my case)
     
  2. TommyDoomsday

    TommyDoomsday

    Joined:
    Nov 30, 2018
    Posts:
    2
    Did you ever find a solution? I am having a VERY similar problem with my project