1
$\begingroup$

How to set the physics type to No collision in bge using python?

I need a script to change the physics type to No_collision in game, please help me

$\endgroup$
1
$\begingroup$

You can't change the physics type.

You can replace the object with another one, that is of the desired physics type. Do not forget to copy all necessary attributes from the previous object (such as linear and angular velocity).

$\endgroup$
0
$\begingroup$

hmm try using

cont = bge.logic.getCurrentController() 
obj = cont.owner
obj.suspendDynamics()

if it doesn't fit your needs you will have to replace the object by another one which has the collision type you want in-game.

$\endgroup$
  • $\begingroup$ Yvain, this script just stops dynamics, but does not change its type to No_collision :( $\endgroup$ – user22892 Mar 20 '16 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.