I don't care about the camera of the humanoid but about the humanoid's position in the world. The world is 3D: X, Y, and Z. How can I know if a humanoid is walking in the X plane, Y plane, Z plane or a combination of these? I need to take an action based on which dimension the humanoid moves...
The location of the humanoid can be found from any object inside the NPC/Player that contains the "Position" property, such as base parts including the torso or head.
The Position property is a three-dimensional Vector3 with an X, Y, and Z coordinate.
If their position before was (0, 0, 0) and their position after was (3, 0, 10) then they moved on both the X and Z axis but mostly on the Z axis. If the Y axis increases, that means they're higher up than they were before.
A very basic version of what you're talking about could possibly look like this:
local model = workspace:WaitForChild("NPC") local torso = model:WaitForChild("Torso") local x = torso.Position.X -- the X position before it moved -- wait for the humanoid to move, or maybe use the changed event on its position if x ~= torso.Position.X -- if the current position and the original X position are not the same, then it moved -- do stuff? end
That's probably not the best way to do it, but I'm not really sure what your goal is and it seems like you're not very familiar with Vector3 positions yet.