The devforum page tells me absolutely nothing, and just confuses me. How do I use this with MoveTo aswell?
It is a function you call on a CFrame. It is the equivalent of a CFrame made relative to the world's center (0, 0, 0) and also equivalent to just doing CFrame times CFrame
.
local cf = CFrame.new(0, 5, 0) print(cf.Position.Y) -- 5 cf = cf:ToWorldSpace(CFrame.new(0, 10, 0)) print(cf.Position.Y) -- 15
An alternative function that uses a Vector3 instead is called :PointToWorldSpace()
which will do exactly the same thing but relatively with a Vector3 instead of a CFrame.
You can find more out here.
:ToWorldSpace() returns a CFrame relative to the center of the world (0, 0, 0). So if object C’s CFrame is 0, 10, 0 away from 0, 0, 0, it would return 0, 10, 0. link