- Home /
Wait for a while before executing the code c#
I'm trying to make my medal go back to its original after it has been brought into the scene
The following code below shows the medal being brought in the scene but I am unable to let it slide back to its original position after awhile, approximately 5 seconds after it entered the screen.
void OnMouseDown ()
{
if (tag == "giveChange")
{
if (Customer.cashChange.ToString () == Background.correctChange.ToString ())
{
correctAns++;
if (correctAns == 1)
{
startMarker = medal.position;
endMarker = medal.position - new Vector3 (0, 8, 0);
journeyLength = Vector3.Distance (startMarker, endMarker);
}
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Move Transform to Target in X seconds 3 Answers
make my gameobject lerp between points more smoothly 0 Answers
Vector3 Lerp mis-match 0 Answers
Raycast hit skips 1 if statement at hit 0 Answers
moving between two points over time 1 Answer