- Home /
Question by
Bokaii · Aug 11, 2014 at 07:02 PM ·
multiplayerfpsinvokeparkour
unity3d invoke
When I use:
void Update(){
if(Input.GetKeyDown(KeyCode.E)){
Invoke("DoSomething", 5);
}
}
void DoSomething(){
print("Test");
}
It prints "Test" like 17 times! why?
Comment
If you only have this script attached to one game object, you will get one 'Test' output for each time the key is pressed. But that output delayed by 5 seconds from the time the key is pressed.
Your answer
Follow this Question
Related Questions
Add one on local z axis 3 Answers
yield WaitForSeconds c# 4 Answers
[CLOSED]RaycastAll Help 1 Answer
Photon enable/ disable object 2 Answers