I'm hoping thats the correct way to phrase this question. I trying to increase an objects size a certain amount over 3 seconds. I have a script to instantiate the prefabed object. This is what I have so far.
var expand : Vector3 = new Vector3 (2,2,2);
function Update ()
{
StopWhen();
}
function StopWhen ()
{
transform.localScale = expand * Time.deltaTime;
yield WaitForSeconds (3);
Destroy (gameObject);
}
Time.deltaTime obviously doesn't work as its the length of time it took to complete the last frame. Time.time doesn't work because after playing for say 30 seconds when you instantiate the object its HUGE because Time.time is the length of time since the game started or something there abouts. What I'm looking for is a syntax for time which means "the length of time since this button was last pressed" I understand that there may not be one (as I'v been lookin for a while now) and that I may have to script the functionality of a timer which starts/resets on a button press. Any help in this matter would be greatly appreciated, I'v put off asking this question and used cheating (not literally just more coding than necessary) and fixes to acheive similar things in similar situations but none of them can achieve the same result for this.
You sir are a legend, I was so busy trying to mess around with the time syntax that I never thought to try change my equations. Thank you very much.
– anon61858128