switch help
I have a switch that turns on the light whenever my actor overlaps it, but the problem is that the switch toggles between on and off every single second my actor is overlapping. I need to make a few boolean and integer attributes to stop the automatic switching on and off of the switch to: actor hits switch then only after 3 seconds can the actor hit it again.
thanks
thanks
Best Answer
-
UtopianGames Posts: 5,692
Make a boolean called SwitchActive leave it set to false then when your player hits the switch change it to true. Have a rule with a timer inside..something like if game.SwitchActive=true after 3 seconds change attribute game.SwitchActive to false.
Darren.
Answers
When main actor overlaps switch actor,
and transition = 3
then after .01 (RTC)
change attribute Transition to 2
___________________________________
When main actor overlaps switch actor,
and transition = 2
For 2 seconds (RTC)
every 1 second Change attribute to transition to transition-1
___________________________________
When transition = 1,
change attribute (transition) to 3,
___________________________________
When main actor overlaps switch actor,
and Transition is greater than 2.9,
and isLit is false
Then change attribute isLit to True
___________________________________
When main actor overlaps switch actor,
and Transition is greater than 2.9,
and isLit is true
Then change attribute isLit to false
Grrrrrr....what should I do?
http://www.mynameisace.com/switch.gameproj.zip
Ace
Thanks for the help
I'm on my phone so can't test it in the project but just try that in my example.
Ace
http://www.mynameisace.com/switchcollide.gameproj.zip
Ace
Ace
If you ever need help with anything or some art then let me know.