Stu: is there a getattr() or something that lists the properties an obj has?
download this python file and put it in your blender directory.
Type this into one file in blender:
from APPLE2 import initGame,ragdollConstraint
own=initGame()['own']
cont=initGame()['cont']
ray=cont.getSensor('ray')
lmb=cont.getSensor('lmb')
if ray.isPositive() and lmb.isPositive() and own.time > 0.1:
ob=ray.getHitObject()
if ob.getPhysicsId() != 0:
own.const=ragdollConstraint(own,ob,[0,0,0])
own.time=0
of course, you’ll have to add the “ray” and “lmb” logic bricks and the integer property “const”. Connect those two logic bricks to the python controller.
Type a new file:
from APPLE2 import initGame,removeConstraint
cont=initGame()['cont']
ray=cont.getSensor('ray')
lmb=cont.getSensor('lmb')
if ray.isPositive() and lmb.isPositive() and own.time > 0.1:
ob=ray.getHitObject()
removeConstraint(ob.const)
own.time=0
Connect the same two sensors to this NEW python controller. This should work. Holler if it doesnt.
P.S. you might want to change it to a point-to-point constraint. change the ragdollConstraint() function to p2pConstraint() and it should be fine