- Home /
on trigger enter - play mecanim animation
Hi, I'm totally new at scripting and unity and I need help, this is my current script:
var Wife02_Anim : Animator; //stores the animator component
function Start ()
{
Wife02_Anim = GetComponent(Animator); //assigns Animator component when we start the game
}
function Update () {
}
function OnTriggerEnter (other : Collider) {
Debug.Log("praejo");
Wife02_Anim.SetFloat ("praejo", 0.2);
}
I don't know why but as soon as I enter the trigger the game pauses.
What it should do is to make a transition to another animation, when "praejo" is greater than 0.1
Are you getting any errors when you enter the trigger?
I asked just because it seems odd that the game paused but you dont have code to pause it and there's no errors. So you can't move or anything after you hit the trigger, or you're able to pass through and nothing happens?
One thing to note (iirc) is that if neither object has a rigidbody, unity will not detect the collision for triggers.
Your answer
Follow this Question
Related Questions
Mechanim Trigger Issue 1 Answer
Basic animation key press 0 Answers
Mecanim Trigger event on specific frame of an animation 4 Answers
Why isn't my animation being played? 0 Answers
Trigger Animation Instantly? 2 Answers