Dec
19
2015

Mecanim Simple Trigger Animation Example

mecanim_unity_trigger_shoot_anim_1

Simple test project, triggering shoot animation on key press, and not triggering it, if its already running.
Also one Animation event call included, could be used to spawn the projectile at correct frame.

Project sources:
https://github.com/unitycoder/UnityMecanimBasicAnim

Resources:
– Sprite created with Universal LPC Sprite Sheet Character Generator

References:
http://docs.unity3d.com/ScriptReference/Animator.StringToHash.html (should be better than using strings)
http://docs.unity3d.com/ScriptReference/AnimatorStateInfo-shortNameHash.html
http://docs.unity3d.com/ScriptReference/Animator.SetTrigger.html (Easier to use than Bool parameter, automatically gets set back to false)


Leave a comment

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.