- Home /
Visual timer? Like CUT THE ROPE
Hey everyone I'm looking to make a simple time based animation, in which a circle (or a clock) is fully coloured, and eventually as time passes by, it gets empty.
A concrete example would be the stars from "cut the rope" which have a timer on them. http://www.youtube.com/watch?v=bdtngxp7YBs (Watch from 20s Onwards)
Please let me know.
Currently, I'm able to destroy the star after a set amount of time using a coroutine and waitforseconds.
Please tell me how I'd get that visual effect to work, thanks!
A picture or video reference for your question would be helpful. The technique used in the following answer could be adapted to work with many timer displays:
http://answers.unity3d.com/questions/14770/creating-a-circular-progressbar-timer.html
Answer by MileSplit · Dec 21, 2013 at 03:38 PM
You could use an animated sprite, and when the animation ends you destroy the object, you would have to create it in photoshop or GIMP.
Answer by EBR · Dec 21, 2013 at 04:37 PM
You can have a script on your clock/circle which has an output, this output can then be used to animate the colour or position of the clock/circle. Hope this helps, here is a simple script that you can use:
using UnityEngine;
using System.Collections;
public class Timer : MonoBehaviour {
public float timer = 5;
public float timeleft;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
timeleft = timer - Time.time;
if(timer <= Time.time)
Destroy(gameObject);
}
}
I'd like to know how the clock/circle would work. I'm familiar with the timer script itself, and have already scripted one.
Your answer
Follow this Question
Related Questions
time synchronization via Photon 1 Answer
Subtract milliseconds from 12 hours? 1 Answer
Simple Timer 2 Answers
How accurate is Stopwatch.ElapsedTicks? 0 Answers
How do I make a Countdown Timer in Minutes and Seconds only 1 Answer