How to check a part's position relative to another part's position?
I know how to change a part's position based on another part's position, but I can't figure out how to check if a part is, say, three units above another one. Can anyone point me in the right direction?
EDIT: Tried this, didn't work.
Error: Workspace.number.Script:3: attempt to call field 'Position' (a userdata value)
2 | local mine = game.Workspace:FindFirstChild( "mine" ) |
3 | if mine.Position = = script.Parent.Position + script.Parent.Position( 4 , 0 , 0 ) then |
4 | game.ReplicatedStorage:FindFirstChild( "1" ):Clone().Parent = script.Parent |
8 | script.Parent.ClickDetector.MouseClick:connect(checkmine) |