Motion Actuator != Python Motion ?

(Tinman) #1

Hi, I’m having some trouble converting the motion actuator bricks to python. I have used the motion actuator blocks with linear velocity and it works very well for traversing uneven ground. The character will keep a constant velocity on hills, ramps, etc. I run into trouble with jumping though. I’d like to have the forward movement slowed down when the character jumps, so that the character can make smaller jumps. Or let the charcter be able to be moved left and right while in mid-air for jumping from platform to platform in sidescroller games. This would require setting X and Z motion together or separatly depending on what actions were to being performed. This would require separate motion actuator blocks, which end up overwriting each other.

So, I though I could do this in python. The thing that has me stumped is that when I use the linear velocity motion actuators in python my character gets pushed back from slopes and walls. It’s like the objects it collides with push back. These same objects dont push back a character using linear velocity motion blocks. I can’t figure out why. So I made a demonstration file. There are two cubes. One uses blocks, the other python. The block one can climb the slopes… the python one gets pushed away from the slopes. The up and down arrows control both cubes. Can anyone tell me why the further cube can’t stop midway on the slopes, or stop against the walls?

I put the file on my homepage -


(z3r0 d) #2

so you’re setting the linv values of a motion actuator in python?

the trick is that when you recieve a false pulse from a keyboard sensor [the key has been released], instead of setting the linv to zero on the motion actuator, send the motion actuator a false pulse. The motion actuator doesn’t know what type of motion you’re doing if it’s set to zero, and a false pulse for linv motion is defined to stop the linv motion… [unless it is in add mode]

… at least, that is what I can say without looking at your file

the bounce back problem I haven’t solved, but I do know that if you make everything smaller the effect is less [or perhaps more] severe [I forget]