yield new waitforsecond(1) counter time varying after ludo dice roll.
in ludo 2d game i am using player turn timer 30 sec by using yield new waitforsecond(1) whenever timer goes to 0 and player dont roll dice then dice will move to next player my problem is in starting timer work perfectly player chances skip if they dont roll dice and timer work totally perfectly for all 4 player untill they roll dice but when dice roll i mean rolling animation start after timer start varying very fast whenever dice rolling and tits look like waitforsecond(1) depend on dice rolling and after some dice rolling time goes to 0 from 30 in few second and i want in 30 sec timer goes from 30 to 0 .
here i have changed code two times
first with waitforsecond(1) float currCountdownValue; public IEnumerator StartCountdown(float countdownValue = 30) { currCountdownValue = countdownValue; while (currCountdownValue > 0) { Debug.Log("Countdown: " + currCountdownValue); yield return new WaitForSeconds(1.0f); currCountdownValue--; }
if(!isdicerolled){
if(playerTurn == "RED"){ playerTurn = "BLUE"; InitializeDice(); } else if(playerTurn == "BLUE"){ playerTurn = "GREEN"; InitializeDice(); } else if(playerTurn == "GREEN"){ playerTurn = "YELLOW"; InitializeDice(); } else if(playerTurn == "YELLOW"){ playerTurn = "RED"; InitializeDice(); } }
}
secong time i was using time.deltatime but it also giving me same output
so what should i do now i want timer like teen patti game , poker every thing work but after rolling dice time is varying pls help me
Your answer
Follow this Question
Related Questions
Sprite animation with different frame durations. 0 Answers
How do I run an animation then destroy a game object? 0 Answers
Change capsule size on key GetDown 1 Answer
VERY LOW FPS ON IPAD TEST 2 Answers