You’re cleared to 0 the Timeout.currentTime at the end of the OnCheck.
But coroutine does not yet finished, the addition process to Timeout.currentTime you would be done .
Probably you have to correct in this way.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
protectedoverrideboolOnCheck(){
if(currentTime<timeout.value){
if(currentTime==0)
StartCoroutine(Count());
returnfalse;
}
returntrue;
}
IEnumerator Count(){
while(currentTime<timeout.value){
currentTime+=Time.deltaTime;
yield returnnull;
}
currentTime=0;
}
Login
Register
By registering on this website you agree to our Privacy Policy.