Resetting elapsedtime back to zero
Having trouble with Time.time
I have this:
float waitStartTime = 2;
and
float elapsedWaitTime = Time.time - waitStartTime;
if (CurrentPosition >= 0)
{
Debug.Log (elapsedWaitTime);
if (elapsedWaitTime > waitStartTime)
{
CurrentPosition++;
Debug.Log (CurrentWayPointID);
}
}
waitStartTime is set to 2, it goes to the first state, waits, and then progresses to the next state once waitStartTime is reach, but everytime it restarts the statement, elapsedWaitTime is just increasing with Time.time. I can't figure out how to stop Time.time resetting ElapsedWaitTime to reset back to zero?
Comment
Your answer
Follow this Question
Related Questions
How to record 360 video during gameplay in unity? 1 Answer
Baked materials from blender cycles don't appear right in my scene? 0 Answers
Level's menu 0 Answers
Turning on an option with GPS 0 Answers
Unity Devloper Website Dashboard will not load on Chrome, constant refresh loop, can you help? 2 Answers