Changing MeshInstance position

I have an entity with a model that contain few MeshInstances, and I’m trying to update the position of the each MeshInstance independently.

But when I try the following code


Where newPosition is pc.Vec3. The position of the MeshInstance is not changing, it remains the same. Is there something I’m missing?

I want to change the position and rotation of MeshInstances individually

Hi @PC_Coder,

That should work as expected, gave it a quick try on the following simple example:

Can it change the position of MeshInstances individually? If it contains the submeshes? Because in my case it is changing the position of complete mesh.

Here i’m trying to change the position of windows of a truck mesh which are at index 2 by


but it changes the position of complete truck

Right, so for the tyres it worked:

But as you said, not for the windows, the reason is that the trunk, body and window mesh instances all share the same node.

Here I imported in Blender and you can see them grouped like that. You can split them in Blender or a similar app to separate nodes and then you will be able to move them on their own:

1 Like

Okay thanks for your quick assistance :slight_smile:

1 Like