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

Doubts on Animation after Collision

Discussion in 'Scripting' started by Maulkor, May 18, 2019.

  1. Maulkor

    Maulkor

    Joined:
    May 14, 2019
    Posts:
    1
    Hi guys! Nice to meet you all!

    I'm Mauro Cordeiro from Brazil, developing a simple casual funny game.

    The objective is walk towards enemies, and On Collision, an Attack/Eating Animation is activated, then it comes back to Idle.

    Imagine I'm playing, in Walk Animation State. So I hit an enemy, it vanishes, and I'm there, in Idle during this event.

    So...

    How can I "call" my "Attack" animation from my Animator Tab on code, when my Player hits the Random Enemies?

    PS: "Attack" action on my game is Automatic. It's just about colliding on enemies, and avoiding other bigger enemies (unless you hace powerUps).

    I also did my Bool Transitions (two direction arrows, True/False) for my "Attack" Action.

    Thank you all so much guys! I'm completely newbie on coding, so all your help will make me the happiest guy in the world!

    We Rock!

    Mauro.