'Stop Timer'-Help Needed
-
I need the piston to stop, like a stopwatch after the visible box has been touched. Its for a racing game. Any ideas on how i can do it? (Everything in the .skp)
-
I used this code in the 'ontick'
To start the "timer" press "A" (the SP Controll Panel must be visible and ontouched)
if key("A")==1 setVar("start",1) setVar("stop",0) end if getVar("start")==1 setVar("time",getVar("time")+1) end if getVar("stop")==1 setVar("start",0) endThe timer stops when the box is touched by the ball
and the timer also start again when you press "A" again.if you want to reset the timer every time you press "A" (or another key)
put this line into the 'ontick' at the third line before the first 'end'.setVar("time",0)Hope this helps!:D
-
@hpnisse said:
I used this code in the 'ontick'
To start the "timer" press "A" (the SP Controll Panel must be visible and ontouched)
> if key("A")==1 > setVar("start",1) > setVar("stop",0) > end > > if getVar("start")==1 > setVar("time",getVar("time")+1) > end > > if getVar("stop")==1 > setVar("start",0) > end >The timer stops when the box is touched by the ball
and the timer also start again when you press "A" again.if you want to reset the timer every time you press "A" (or another key)
put this line into the 'ontick' at the third line before the first 'end'.> setVar("time",0) >Hope this helps!:D
Thanks, but it is not want i want, i want something that starts at fraem 0 and then the timer stops like a stopwatch when the box is touched, so, that is useful, but not what i want.
-
Okey...
change the first line
if key("A")==1to
if frame==0all script
if frame==0 setVar("start",1) setVar("stop",0) end if getVar("start")==1 setVar("time",getVar("time")+1) end if getVar("stop")==1 setVar("start",0) endThis is exact that you searching for! (I hope)
-
-
THANKS FOR ALL YOUR HELP!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement