My current script: What can i do so than when my fps controller enters the collision box area for the second time, it doesnt replay the animation?? thx in advance!!
var Animator : GameObject; //Assign this in the editor character with animation
function OnTriggerEnter(){
Animator.animation.Play("Animination"); // name the animation to be played
}``
using UnityEngine;
using System.Collections;
public class guiText : MonoBehaviour {
public GameObject gg;
public GameObject gg1;
public GameObject gg2;
public GameObject gg3;
public static int count;
public bool one,two,three,four;
// Use this for initialization
void Start () {
gg.animation.Play("Des");
one = true;
two = true;
three = true;
four=true;
}
// Update is called once per frame
void Update () {
if(Input.GetButtonDown("Fire1"))
{
//gg1.animation.Play("Ap");
count++;
}
if(count==1 && one)
{ one = false;
//gg1.animation["Ap"].wrapMode = WrapMode.Once;
gg1.animation.Play("Ap");
}
if(count==2 && two)
{
two = false;
gg2.animation.Play("APP1");
}
if(count==3 && three)
{
three = false;
gg3.animation.Play("APPS2");
}
if(count==4 && four)
{
four = false;
Application.LoadLevel("Question");
}
}
}
this is a simple code to play animation once if u click mouse. modify as u wish.
under that . i think it is working.
try this
function OnTriggerEnter(){
Animator.animation.Play("Animination"); // name the animation to be played
Animator.animation.PlayQueued ("PreviousAnimation",QueueMode.CompleteOthers);
}``