4
$\begingroup$

How can I create a "Toggle Switch Sensor", so when I press W to move a cube continuously on the Y axis, and S to stop the movement? Can I do it from logic bricks?

$\endgroup$
4
$\begingroup$

You can do that Very simply using a Boolean property and pressing W to start it moving continuously and pressing W again to stop. See logic setup below W to start and stop
Or you can have W make it start and S make it stop by using the setup below more complicated logic setup

Working blend file with Boolean property

$\endgroup$
4
$\begingroup$

It is possible to do this using a Boolean property and changing it using the toggle option, but it is easier to simply assign an integer a value. A Property Sensor set to pulse mode (to continually check to see if the value is still equal) and that activates your motion.

logic bricks

Blend file with working logic setup

![enter image description here][3]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.