How to toggle power ?
Hey,
I'm making a game where player had to found things to unlock way.
Here, i want to turn on the power of a trigger when a player has clicked on square with a controller sensor.
But i don't know how to do ? ...
Please help me
Thanks !
-
Use a signal manipulator - there's a setting called "toggle on pulse" or something similar, which will turn the output on or off each time it receives a signal.
-
Thanks for your answer Alfinch.
So i placed a "Signal Manipulator" and set it on "Pulse on input on"
Then i set the enter signal on the square of the Controller Sensor and the exit signal on the power of the trigger.
But now the trigger stay always off : / Before and after i press square, it's the same, it didnt activate :/ -
For me, a Counter would be a simpler solution, rather than a Signal Manipulator.
Configure the Counter with a starting value of 0 and a target count of 1. Take a wire from the 'square' output in the Controller Sensor and connect the to the Counter, to make it add. Finally, connect a wire from the 'Counter Full' output into your trigger.
Now when you press square it'll increase the count of the Counter causing it to activate and provide power to turn on your trigger.
If you need to turn it off, then just wire the appropriate logic into 'Reset Count'. -
It works thanks for theese clear explications OgTheClever !!!
To reset i add a timer witch start when we enter in the trigger.
The timer is set to go to 1second.
When the timer reach 1 second, it reset the compter :)
댓글을 남기려면 로그인하세요.