Question about mesh.forward

I checked the forward here Mesh | Babylon.js Documentation (babylonjs.com).

I assume mesh.forward should give different value of Vector3 when turn the mesh around, which means the forward direction. But I always get the same, Vector (0,0,1)
image

, no matter what position of the mesh and facing which direction? Is that supposed to be like this? Do I misunderstand what mesh.forward is?

How can I get the direction of the mesh?

Here is the playground I’m using
Forward test | Babylon.js Playground (babylonjs.com)

Forward is a direction vector. normalized. It works when you rotate the mesh. For example 90 degrees on the Y axis:

Forward test | Babylon.js Playground (babylonjs.com)

Notice that forward is now 1,0,0.

The position of the object doesn’t matter in that case. it’s not “the next forward point in world space”, but a direction from the object itself.

1 Like

In your PG you are moving and rotating the camera. If I am facing north it does not matter where someone takes a picture of me I will still be facing north.

1 Like