The physics engine acting on the instance is not working

The physics engine acting on the instance is not working
The sphere can fall freely before adding an instance, but it will remain motionless after adding an instance.

sphere.thinInstanceSetBuffer("matrix", bufferMatrices);
sphere.thinInstanceSetBuffer("color", bufferColors, 4);

Hello @lxq100 , how are you doing?

My understanding is that thin instances and the physics system are not designed to be used together. Iā€™m adding @Cedric here just to be sure. But from what I understand from those systems the physics system is not aware of the thin instances buffer system to update them directly.

What you can do is to use a Transform node that will be updated by the physics system and transfer that information manually to the thin instance system (see example bellow):

Thin instances + physics | Babylon.js Playground (babylonjs.com)

1 Like

When you want to have physics on thininstances you may want to declare them as non-static per the documentation (Babylon.js docs).

Also, you can later change the position of all the instances on lines 40-46 like that.

1 Like

What @riven04 says :slight_smile:

1 Like