Could Somebody Please Help Me?
Could Somebody Tell Me How Do I Make An Offset Between 2 Parts For Example
local PartA = player.Camera
local PartB = workspace.TestPart
– I want to know what is the offset between them
Could Somebody Please Help Me?
Could Somebody Tell Me How Do I Make An Offset Between 2 Parts For Example
local PartA = player.Camera
local PartB = workspace.TestPart
– I want to know what is the offset between them
Subtract PartA’s position/cframe with PartB’s postion/cframe
(PartA.Position-PartB.Position).Magnitude will get you the distance between two parts.
However for the Camera, you will need to get the CFrame’s position, since I don’t think the Camera has a Position property. Like so:
(PartA.CFrame.Position)-(PartB.Position).Magnitude
Why not just
Camera.CFrame.Position
That is exactly what I did - PartA is the camera.
I actually found a better solution
but i did not need the magnitude but its actually close enough to what your saying so ill mark it as a solution
PartA.CFrame:Inverse() * PartB.CFrame