Can someone explain VectorToObjectSpace and its counterparts?

I need someone to explain it. I don’t care how in-depth you go, as long as I know more or less how it converts the variables. I need it to learn to make the Character head face my mouse or camera using its Motor6D.

Well here is a gif ripped from the CFrame math operations article:

Applying it to Motor6D, the second CFrame axis will represent the Motor6D C0 axis which the motor6D Part0 CFrame, and the first axis represents the world axis.

For a Motor6D if you are working with the C0 then the CFrame of the C0 will be relative to the Part0 of the Motor6D so we need to convert the vector, like a position vector in world space relative to the CFrame of the Part0 of the Motor6D

local motor6D --somewhere
local targetPosition = part.Position
local positionRelativeToPart0 = motor6D.Part0.CFrame:PointToObjectSpace(targetPosition)
motor6D.C0 = CFrame.lookAt(motor6D.C0.Position,positionRelativeToPart0)
1 Like

Thanks, this is exactly what I needed.