I made a script for moving a character (with character physics type) that is working like expected in 2.64, but not in 2.65 even if i don’t modified the script or the .blend. It seems that motion is continuously applied to the character even if the dLoc is [0,0,0]. I tried to change the physics of the character Dynamic type and it works properly. Is the same for you guys?
I have uploded a blend.character.zip (297 KB)
I may be wrong, but I had issues with the default parameters in 2.64 build for character physics. Try creating the object in 2.65 and see if it works on its own.
Ok, i think i figured out.
I started a new blend, added a cube (physics => character type) and added a new script:
if press W on keyboard
set dLoc to = [0, 0.1, 0]
else to [0, 0, 0]
activate the motionActuator
It still behaves differently from 2.64. But if add the control to check if the keyboard sensor is positive, and if it is, activate the motion actuator otherwise deactivate it, it works like expected. In 2.64 it was suffice to check if the actuator was equal to bge.logic.KX_SENSOR_ACTIVE, in 2.65 it isn’t… and i don’t get why. Maybe i was using the API improperly?
I think you are mixing the terms actuator and sensors. This makes you text a bit hard to read ;).
Btw. Loc is a location change which means your object teleports rather than moves.
You can apply forces which results in a motion.
Or you apply a velocity which is a motion.
I do not know if that makes any difference to your situation.
I’m sorry: i messed up with terms. I edited my previous posts.
I know dLoc is a translation but i don’t understand why the motion is applied even when dLoc is a Zero vector. And when i set the physics type to Dynamic it works in the way i think it should (like in version 2.64).
There were changes to the way character physics handles motion, which makes it behave a lot better. Unfortunately, it seems I may not have fixed all of the issues to make the logic brick still behave the same. If you’re already using Python, then just drop the motion actuator and move the character directly by using KX_GameObject.apply movement() every frame.
Yes, i will follow your suggestion, Moguri. One question about that: move a GameObject with applyMovement is slower compared to move it with the motion actuator?
However thanks for yours attention guys.
If you just compared the logic brick versus the function, then yes the logic brick is faster. However, odds are you’ll be adding more logic (jumping for example) that will be easier took do with Python instead of a convoluted logic brick setup. And Python isn’t much slower when you look at the headaches of dealing with logic bricks.