How would I get a magnitude between Mouse.Hit and the Player's Head?
I am making a placement system where I do not want to be able to move the part inside a certain radius of the player's head.
I have currently tried doing stuff like:
if (Mouse.Hit.X - Character.Head.Position.X) and (Mouse.Hit.Y - Character.Head.Position.Y) and (Mouse.Hit.Z - Character.Head.Position.Z) >= 20 then --Do stuff here end
But it does not seem to work properly, I am able to move the part to a certain extent (I can not move the part freely, it gets "locked" whenever I try moving it behind the player, but it gets locked no matter how far away I try moving it behind the player from.)
Any help is greatly appreciated!
You will want to use the magnitude property of the difference of your vectors.
if (Mouse.Hit - Character.Head.Position).magnitude >= 20 then --Do stuff here end