path.vectorPath doesn't take player's height into consideration?

I am trying to follow the getting started guide on my own scene.

If my player is a cube with scale (50, 50, 50), to put it on top of Y=0 plane, I need at least Y=25.

So I put it at (0, 25, 0).

Problem is, on play, path.vectorPath[0] returns (0, 0, 0). And since my player is at (0, 25, 0), (path.vectorPath[currentWaypoint] - transform.position).normalized doesn’t give me the correct direction of movement at all.

Am I missing something important? Why isn’t path.vectorPath[0] (0, 25, 0)? my player should be moving horizontally towards the target position, why is Y=0?

I don’t get it, the green path is right, but there seem to be no option to adjust player (AI) height in terms of pathfinding.

I checked diameter in collision testing and it’s not for it.

What do I have to do? There isn’t a single document talking about the scale (size) of player agent and how to handle it.

Hi

Usually you put the pivot point of the player at the feet to avoid these issues.
Generally the pathfinding system does not care much about the height of the character, that is handled by the movement script if it needs to be handled.

That makes sense, but it’s not exposed by default with Unity (pivot = center of your object).

Wouldn’t you think it’s a good idea to mention it in the getting started guide?

The fact that these lines work at all:

Vector3 direction = (path.vectorPath[currentWaypoint] - transform.position).normalized;
direction *= speed * Time.deltaTime;
controller.SimpleMove(direction);

is because your agent size is 1, anything else will break it.

Unity doesn’t say anything about where the pivot is supposed to be, it is where you place it.
(do not confuse this with the option for showing the transformation handle at the center of the object, that is not the pivot).

The script in the get started guide is very simple, it is just intended to get you started with following a path.
If you want a better movement script out of the box you can use for example AIPath (see the example scenes for how to configure it).