- Home /
Question by
RuiFerreira · Nov 05, 2013 at 08:41 PM ·
animationjavascriptsoundclock
Java Script: Clock script help.
Hello, I was wondering if anyone could help me on this! I have this clock script and i want it to play a sound and play animations on multiple objects when it hits zero. Help?
#pragma strict
var timer : float = 10.0;
function Update ()
{
timer -= Time.deltaTime;
if(timer <= 0)
{
timer = 0;
}
}
function OnGUI ()
{
GUI.Box(new Rect(10,10,50, 20), "" + timer.ToString("0"));
}
Comment
Best Answer
Answer by FPSworrior · Nov 05, 2013 at 09:49 PM
if(Timer == 0)
{
animation.play("animation");
}
I can't remember how to do the audio script part.
Your answer
Follow this Question
Related Questions
Current speed of an object? 5 Answers
Animation play on input, else play idle animation. 2 Answers
Punch Animation Doesn't Work And Others Do... 1 Answer
Enemy Attack Animation 1 Answer
Walking animation problem. 0 Answers