PhysicsConstraints problems

Hey All,

So I found this fairly useful template for making a vehicle called “tunnel run” at “Tutorials for Blender 3D”. It uses the Physics Constraints module which is under the undocumented section of the blender documentation. The biggest problem I am having is that when I parent something to it, in game, I cannot totally remove the parenting again, in game.

character.setParent(car,0,1)
character.removeParent

Has anyone else come across this or know where I can find documentation on this subject?

Thanks

I think you use:
character.setParent()
to remove the parent else you can use logic bricks to remove the parent.
Here is the link to the python documentation.
http://www.blender.org/documentation/248PythonDoc/GE/index.html

Direct link to parent actuator info:
http://www.blender.org/documentation/248PythonDoc/GE/KX_ParentActuator.KX_ParentActuator-class.html

removeParent is a function so use removeParent() instead.

beside that, this has nothing to do with PhysicsConstraints nor the vehicle wrapper.

Thanks Monster, you were right. I had forgotten the parenthesis at the end of the character.removeParent()
Now, any ideas why GameLogic.setGravity([0,0,-32.2]) causes my car to fall apart then disappear?

My car does not do this, but it is pressed heavy into its suspension. (try the VehicleWrapperDemo)
It might be that your car is pressed through the ground. So you can’t see it anymore. Switch to wireframe to verify that.

Hey Monster, Ya when I first had the problem with the car disappearing I thought that it was like you said just falling through the graphics somehow, so I set up a property to monitor the car’s position. When the car disappears the property sends an error.

And when I said that the car falls apart I mean, the wheels fail to get attached to the vehicle and the vehicle remains unsupported by the wheels. when I try to move the vehicle using the same script as was provided using the demo I linked, nothing happens.

I will have to look into the Vehicle Wrapper you suggested, Thanks again for your help :slight_smile: