Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i check the Y difference between the player and the baseplate? eeeeeeeeeeeeee

I'm making a wall hopping game 2000 studs and i want to let the player know how many studs the player is above the baseplate;

The problem is i only want it to change on the Y axis :/

local TextLabel = script.Parent

local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
wait(2)
local Character = Player.Character
local LeftLeg = Character["Left Leg"]
	
while RunService.RenderStepped:Wait() do
	local dist = (workspace.Baseplate.Position - LeftLeg.Position).Magnitude.Y
	
	print(dist)
	TextLabel.Text = "Height: " .. tostring(math.floor(dist)) .. "Studs"
end

1 answer

✓ Accepted answer

You can try this:

local distance = (part.Position.Y - baseplate.Position.Y)
print(distance)

This discussion is preserved as it was. New answers, comments, and votes are closed.