[Solved] Change physics properties using haxe



I was wondering how I could access the physics properties of an object which has a rigid body using haxe.

I have a rigid body which at some point I do not want to behave like rigid body anymore (and therefore save computational time). However, I was not able to find such properties in my object.

Any hints are greatly appreciated.

var x = object.getTrait(RigidBody);
// Do stuff with x


As @trsh mentioned that’s how you can get access to the mesh’s rigid body.

After that you can use the RigidBody’s setActivationState method with a value of 5 if I remember correctly to stop applying physics simulation to that particular RigidBody


I ended up adding and removing RB trait :slight_smile:


That’s another way to go hehe :slight_smile: