Search Unity

Question Change sprite color when hit

Discussion in 'Animation' started by tkdguralswjdgood, Aug 23, 2021.

  1. tkdguralswjdgood

    tkdguralswjdgood

    Joined:
    Aug 12, 2019
    Posts:
    1
    Sorry about my poor english. And this is my first post. I want to change sprite's color to red and back to normal slowly when hit. So I made "Player_hit" animation that change sprite's color property.
    But the problem is, I also have Player_right, Player_left animation for player's movement. So when Player_hit animation playing, Player_right and Player_left animation stops instantly and it looks wierd. I don't want this to happen.
    Do you have any idea how to play both animation at the same time, or is there other ways to do it? I need your help. I'm struggling with it for 5 days.
     
  2. KalOBrien

    KalOBrien

    Administrator

    Joined:
    Apr 20, 2021
    Posts:
    89
    Hey this may be better suited in https://forum.unity.com/forums/getting-started.82/ as a scripting question.

    I recommend changing the sprite color via a script versus animating it manually. That way you can avoid the quick flash away from it.

    This is a great tutorial showcasing what I mean: