How do i avoid that the controller sensor sends multiple signal outputs when the player starts button mashing
Is there a way to make sure the controller sensor only sends one signal at a time?
Context: designing a functional rubiks cube I want to avoid that it's possible to rotate several faces at the same time. If this happens the cube start to glitch. The rotation of every face is connected to a button output. When the controller sensor receives an input, the sensor is shortly turned off to avoid a new signal is send before the needed rotation is completed. This seems to work very well but when the player mashes two buttons at the same time both will send an output signal. Is there a way to disable this?
-
There's probably a few ways to do this. The first one that pops into my mind is to use an "AND" gate for each command, and wire a switch into the the second part of each and gate. Then you could use a keyframe that turns that switch off during each rotation animation.
But someone better at logic than me could probably give another way.
Andy -
Exclusive gates might be another way to go. Given the same name, they only let one signal through at a time.
-
Just to riff off of what Andymation said.
Wire all of your "inputs" into an "AND" gate and into the "+1" of a counter.
Wire "counter full" into a not gate. Wire the Not gate into the other side of the AND gates.
Wire the "Animation complete" of all your animations into a node and wire that into the counter reset.
Now only one animation can play at once. -
I do this with a Selector.
The Selector will only pass through one port at a time so you can never get two together. So you wire up, for instance, 'No Input' to port A, 'Up, to B, 'Down' to C etc... like that. Then you'll only ever get the one signal at a time.
Войдите в службу, чтобы оставить комментарий.