I’m wondering how I could go about checking the distance of a player from a certain point but only along the x and z axis. I know about .magnitude but that includes the y axis and I want vertical motion to be irrelevant here, anyone have a solution to this?
Take the positions of each point and multiply them by Vector3.new(1,0,1), then use .Magnitude.
Example:
local PointA = Player.Character.HumanoidRootPart.Position*Vector3.new(1,0,1)
local PointB = Brick.Position*Vector3.new(1,0,1)
--Assuming Player and Brick were already assigned
local Distance = (PointA-PointB).Magnitude
2 Likes
You could get the positions of both the point and the HumanoidRootPart of the player, and maybe do some subtraction along with math.abs with the X and Z positions. Probably not optimal, but an alternate solution.