Posts

Showing posts with the label Animation

DIGM530 - Coral Invasion - Sources

Image
Unity - Making 2D Sprite Flash Upon Taking Damage Make A Sprite Flash? - From Unity From gilad905 in this post: Create an animation controller state machine and an animation clip for the flashing state, just like creating a normal animation state. If you want to mix the flashing with another animation (e.g flash while walking), create a new animation layer in the animator and do all below in the new layer. In the new layer's configuration, make sure it's set to Blending: Additive (so it won't override the base layer) and that its weight is set to 1. Enter the animation view (Window -> Animation), chose the wanted GameObject and the empty animation clip you just created. If any properties are already attached to the clip, remove them. Click 'Add Property' -> Sprite Renderer -> Enabled -> the '+' icon near it. Using this, you make the object flash by turning SpriteRenderer.Enabled on and off. But for a different effect than flashing, you can...