2
$\begingroup$

With Logic Bricks, how can I make my windshield wiper move back and forth until I turn it off? When I press a key to start the movement, I can move left to right, but not right to left without a different key press.
I'm in Blender 2.79, Blender Game Engine.

$\endgroup$
2
$\begingroup$

Animate your windshield wipers moving back and forth, just one complete cycle.
wiper animation

Then add an Action actuator to play it. Make sure to set the EndFrame to match the length of your animation. Change the Action Playback Type from Play to Loop Stop, and choose the name of the action (by default is is named "Object name + Action")

The trick here is you want the keyboard sensor triggering a Property actuator, not the action actuator, then the property will trigger the action.
Add a game property, a boolean named "wipers" leave it false by default (blank checkbox).

Connect the keyboard sensor to a Property actuator, set it's mode to Toggle and choose the property you just created (wipers).

Now back on the sensor side, add a Property sensor, connect it to the action actuator. Set like so: Evaluation Type to be Equal, Property to be your game property (wipers), and the Value to be "True".

The full logic setup looks like this. logic bricks with the game property

$\endgroup$
  • $\begingroup$ I would actually use "loop end" to get them to finish the cycle that they were in rather than stopping in the middle of the windshield. Both are actually valid, because my dad's car is the "loop stop" and it's really annoying, so I'd go with "loop end" just a suggestion $\endgroup$ – Scalia Nov 6 '17 at 3:22
  • $\begingroup$ I'll try this as soon as I get a better graphics card, crashing problems exist right now. Thanks for your help! $\endgroup$ – Tom Nov 6 '17 at 13:35
0
$\begingroup$

Thanks to Monster for answering my question on multiple pivot points on one object, I was able to use the information to make a mechanically correct operation of windshield wipers. The length of the connecting rod between the motor and the wiper bottom pivot point are important, as is the vertical (Z) position of the motor. If you have problems with the wiper going 360 degrees, move the pivot point on the motor arm closer to the motor shaft (shorten the throw). Windshield Wiper1 Windshield Wiper2 It doesn't matter which direction the motor turns, the effect is the same. This isn't a continuous operation, you need to continue a keypress for operation. The time of operation depends on the amount of motor revolutions in degrees.

$\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.