- Home /
Question by
SkyreGames · Aug 18, 2013 at 07:33 PM ·
variablefunctiontagdetection
How to detect if variable is increasing
Does unity have function for this or i just need to stick with comparing old and new variable every frame?
Comment
Best Answer
Answer by DaveA · Aug 18, 2013 at 08:07 PM
As far as I know, you have to save the old value and compare it to the current value.
var oldVal : float =0f;
function Update()
{
if (val > oldVal)
print ("grossing");
oldVal = val;
}