Servo motion trouble on my player

After reading up that using servo motion gave the best results when setting up a player object, I did so and managed to stumble upon a problem I do not know the solution for…

When running diagonally forward I usually start pressing W and then A or D. But when I then release the A or D to run straight again, the player object shifts sideways in the opposite direction of A or D to regain the forward path like its been held in a rubber band that’s been tightening all the time I pressed down A or D together with W. Does that make any sense? The longer I run diagonally the stronger this horrible effect is when I release the A or D…

I have noticed that this goes for all directions. If I press two keys simultaneously the first key to be released will give a “bounce” in the opposite direction for a second.

I do only have WASD sensors and 4x servo motion actuators with the “L” and “Z limit” on.


Can you please send a blend file? I’d like to take a look.

Sure! I’m sorry if my file is messy though…Im not quite sure what to include/exclude when uploading and the uploader failed so I had to zip it :stuck_out_tongue:

Attachments (503 KB)

Funny… My guess is that the actuators fight ower each other and increase there force so You get that effect when releasing one. The fight is this:

w sets x to 0 and y to 18 in velocity.
a sets x to 18 and t to 0 in velocity.

When You press both one try to achieve 18 and the other 0.

Solution - limit w and s on the x axis to 0 force and a and d on the y axis to 0 force - just like You done with z axis already.

Then Your character will slide - fix that with two still actuator - servo actuator trying to achieve 0 speed.

one when w and s is not pressed - setting 0 speed on the y axis (and limited force to 0 on x and z).
one when a and d is not pressed - setting 0 speed on the x axis (and limited force to 0 on y and z).

That should work. Have not seen this before… but I mostly use go forward back and rotate for steering setups.

Okay, the reason of the problem is quite simple.

right now, you W key only affect the y speed but it has not limit on the x speed. Which mean that it will try to affect the x speed in order to make it equal to zero. On the other hand, your A and D key try to make the x speed equal to 18. So your two servo control will fight each other, using stronger forces at each frame, like a rubber band, and the moment you will release one key the other will still be using a really strong force, which will result in your situation.

To make a long story short, to prevent your problem, add a limit to each axis you don’t want your key to affect. The x axis for the W and S keys and the y axis for the A and D keys. In fact, I would recommend you to use limits for all three axis for all your servo control.

Does it help?

Thanks both of you, yes that was probably it! Seems like I have learned a thing or two…:slight_smile:

I’ve used limits now on all servos for the axis that are not in use on the particular servo, and it behaves good now, Yei!

Perhaps worth mentioning that I had to increase the friction on my “platform” material after the change to prevent sliding around on ice :stuck_out_tongue:

Glad the problem is solved. =P