I'll break it down, I want to check if a player can see a part that is within ex:1 meter, how would i do this?
Any help is appreciated! thanks.
I'll break it down, I want to check if a player can see a part that is within ex:1 meter, how would i do this?
Any help is appreciated! thanks.
By using magnitude: (LocalScript)
local mag = (part.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
--Then you can use it like
if mag >= 5 then
--Your code here
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
In Roblox the measurements are studs, so this script will if the player is 5 studs away from the part. Note that this is a LocalScript, you mught need to use a RemoteEvent