I am trying to find the position of an object around a part rather than the world (0,0,0) hence why I am using toObjectSpace.
To perform this task, I have made 2 parts and I am creating a new part which I am trying to position on point B.
–The Script:
local A = workspace.A --Green Part (Origin)
local B = workspace.B --Pink Part
local origin = B.CFrame:toObjectSpace(A.CFrame)
local part = Instance.new(“Part”, workspace) --Grey Part
part.Anchored = true
part.Size = B.Size
part.CFrame = origin + Vector3.new(part.Position)
In this picture, the green part is my new origin, whilst the pink part is where I want my new part to go on.
The new part (grey) is not going where I want it to go