Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What are world to object coordinates?

This is used allot in the stamper script. I am trying to make one myself and no matter how I go about it I still run into this question.

All I know about it is that its a CFrame Method.

1 answer

✓ Accepted answer

World coordinates have an origin, that's (0,0,0). But what if you want to know a part's position relative to another part, that's when you use object coordinates. Object coordinates are coordinates where the object position is the origin of the coordinate system. For example

partA = Instance.new("Part", Workspace)
partB = Instance.new("Part", Workspace)
partA.Anchored = true
partB.Anchored = true

partA.BrickColor = BrickColor.new("Bright red")
partA.CFrame = CFrame.new(25,0, 23) --Just moving it somewhere
partB.CFrame = CFrame.new(25,5, 23) --Moving it 5 studs above

print(partA.CFrame:toObjectSpace(partB.CFrame).p) --0, 5, 0 because partB is 5 studs above partA.

This discussion is preserved as it was. New answers, comments, and votes are closed.