subtracting from float in a user made function
Hi there! It seems that when I use the update function to countdown a float (see timeToDisplay) the debug log reports back a successful counting down.
private void Update()
{
timeToDisplay -= 1;
Debug.Log(timeToDisplay);
displayWallDialogue(timeToDisplay);
}
However when trying to call that same countdown in the displayWallDialogue function that is called in the Update function.
private void displayWallDialogue(float timeToDisplay)
{
timeToDisplay -= 1;
Debug.Log(timeToDisplay);
}
the debug log returns the same number over and over again without actually counting it down. Is there something I dont understand about user made functions? or am I missing an bovious answer here?
Your answer
Follow this Question
Related Questions
transform.position inconsistent numbers problem 1 Answer
Analytics - Funnel parameter (float) is always 0 1 Answer
My calculation won't give me floats. 1 Answer
How to script float the object for add to state machine 0 Answers
Trying to get doors to close after x time since the player has passed through the previous? 0 Answers