A timer that resets every xxx seconds
Hey guys, I'm making a kind of unusual game,
-The idea here is that there's a rotating 1 hand clock that starts at the 6 o'clock position at the beginning of the game
-Rotation of clock hand is constrained with the DayCountdown attribute
-Clock hand should rotate twice a.m and p.m till next day starts (when DayCountdown=0 , dayCount = dayCount+1)
-Days get longer depending on dayCount attribute, they Increase 50 seconds everyday
-Time goes faster permanently when certain accessory is collected, so as the player progresses in the game the clock hand should spin very fast at the beginning then slow down with every passing day (since days increase in time 50 seconds)
Reason for 180 is because the initial hand position was towards 12 o'clock
Daynumber-1 because initial value of Daynumber was 1 and we want an increase of 50 seconds for each day
When countdown reaches 0 dayNumber increases by 1 and countdown for following day increases by 50 seconds
Comments
shouldn't your constraint rotation be something like
180 - (DayCountDown/(100+(DayNumer-1) * 50)) * 720?
since you want it rotate twice per day (720 degrees) and it's dependent upon current DayCountDown divided by the total DayCountDown that was initially set?
and since you're interpolating DayCountDown downto zero counting downward
it's probabably 180+ (... to rotate clockwise
instead of 180 - (... which rotates counter clockwise when counting down.
try it out,
maybe your goal is to rotate counter clockwise. not sure.
Check this out
Countdown setting
Contrain setting
The 1 handed clock is rotating counter clockwise as I needed, but I'm facing a small problem, when the hand spins twice and reaches the 6am position again (start of day) the countdown resets to 25, I don't know where this 25 came from
I added a new attribute and named it countdown duration, I hope this works
With this setting everything seems to be going good, except that the clock isn't resetting at the 6am position. I'm gonna look into it right now
Clock Setting
It works beautifully
glad you got it worked out.