[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.

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

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

1 Like

I ended up adding and removing RB trait :slight_smile:

1 Like

That’s another way to go hehe :slight_smile: