[Solved] Change physics properties using haxe


#1

Hi,

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


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

#3

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


#4

I ended up adding and removing RB trait :slight_smile:


#5

That’s another way to go hehe :slight_smile: