- Home /
increase over time
i have this script, it increases "number" instantly i tried to put * Time.delatTime but that didnt work. did u put it in the wrong place or somehting.
function Update ()
{ var number = Pointslevels.exp - Pointslevels.expde; var posx= transform.position.x; var posy= transform.position.y; guiTexture.pixelInset = Rect (posx, posy, number 12 Time.deltaTime, 9); }
if i add the time.deltatime it starts going crazy and dosnt increase
Answer by Mike 3 · Dec 28, 2010 at 04:43 AM
Maybe something like this? Hard to tell what number is supposed to be doing there, but maybe it'll give you some ideas:
private var number : float;
function Start() { number = Pointslevels.exp - Pointslevels.expde; //set number once to the level values }
function Update ()
{ number += 12 * Time.deltaTime; //increase number by 12 a second var posx= transform.position.x; var posy= transform.position.y; guiTexture.pixelInset = Rect (posx, posy, number, 9); }
Your answer
Follow this Question
Related Questions
how do i control Time.delatTime 2 Answers
Increase ball speed by time 1 Answer
Help with my "speeding up time" script 1 Answer