Hi I wondered if someone would be kind enough to help me try and get my head around the "animator' I have a main character.... a frog. What I need to be able to do is have the frog have a few animations: 1. Idle This I want to be animated using tweens. So i have a tongue etc...all separate body parts that I tween and create a nice loop. 2. Spin When the player touches the character in idle. I want it to jump to a new animation....but this uses essentially a sequence of frames. No tweening it simply runs through pre rendered frames. What I'm struggling with is whether the animator system allows for this swap over of "animation techniques". I have seen a lot of examples but they all use the same method (either sprite sheet/pre rendered OR bone based). Is it possible to combine the two so i can use the state controller to handle all this? thanks very much in advance
i think, you can combine them, why not make frog, add Animator. Create Animator Controller for frog. Drag&Drop this controller on frog´s Animator. Open Animation window. Create animation "Idle". In Animator window set Idle as default animation. Clic "Rec" button in animations window. Use timeline and make animation. In Animation window create new animation "Spin". Drag&Drop your prerendered frames on timeline in Spin animation. In Animator window make transition from Idle to Spin and from Spin to Idle. Create boolean "Touched" in Animator window. Add script for statecontroll to frog. May be with trigger 2D. Add box collider 2D to frog. Set it trigger. Make C# script. Code (CSharp): using UnityEngine; using System.Collections; public class Touch : MonoBehaviour { Animator anim; void Start () { anim = GetComponent <Animator> (); } void OnTriggerEnter2D (Collider2D other) { if (other.gameObject.tag == "Player") anim.SetBool ("Touched", true); } void OnTriggerExit2D (Collider2D other) { if (other.gameObject.tag == "Player") anim.SetBool ("Touched", false); } } In animator window change transitionscondition: idle ->spin, touched true spin ->idle, touched false and make your player`s tag Player. ok, i didnt check it, but you can make something like this.
Have you gotten this to work to you satisfaction? If not, reply here and let us know the state of your project and how we can help.