Help, How to change the behavior when two things collision?

challenge

06-10-2008 06:22:54

I just want to change the direction of one object to the direction I determined when it hit another one. I write the code in the collision function and returned false. But it doesn't make sence, Can anyone warmhearted help me? :)
Thanks very much.

rewb0rn

06-10-2008 10:57:58

What do you mean by it doesn't make sense? If you return false in the collision function the two objects should not react in any way to each other. Now you can apply your own force by calling ->setForce, setTorque or setForceAt(?), etc. on the bodies to move them in a special direction.

challenge

09-10-2008 13:15:56

Thanks very much :) I changed the Torque and the Force in the collision(), it all works. While I just want to change the Orientation of the body. But when I do the setOrientation, it tells me that "Invalid operation for locked space" , what should I do? Can I fix it ?