Change rigid body constraint properties while game running

I would like to be able to change rigid body joint properties in the game engine (while running).

I find this works but only after you stop and start the game - I need to do it on the fly.
ob.constraints[0].use_limit_x = False

I’m guessing this is because all this info is loaded into Bullet before run.

Is there a way to directly change rigid body joint props in the game engine - perhaps something starting with getPhysicsId()… I’m not sure where to go on this one. Help would be greatly appreciated.

The only way I know is to create the constraints during runtime, and then store the contraint ID for later access:

see example: http://www.tutorialsforblender3d.com/GameModule/ClassKX_PyConstraintBinding_4.html

But I would like to see access to constraints already created in blender so if anyone knows how to get a constraint ID from those it would be great :slight_smile:

Has this been implemented in 2.5 yet? I can’t find any API docs on PyConstraints in 2.56

AHA!!!

http://wiki.blender.org/index.php/User:NeXyon/Python/BGE_Migration

the module is ‘bge.constraints’ now- not PhysicsConstraints…