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$

2 Answers 2

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$
1
  • $\begingroup$ Yvain, this script just stops dynamics, but does not change its type to No_collision :( $\endgroup$
    – user22892
    Mar 20, 2016 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .