Get CFrame relative to a different object

What I’m trying to do is kind of hard to explain, but I will try my best.

I am making a first person character controller sort of system for VR, I manage to get the character to rotate and walk where i’m going and all of that stuff, but now I want to replicate the hands and show them in VR using IK (Using this great tutorial )

I am now having a problem with it though, I am only able to get the position of the VR Controller using VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
and that position is not actually relative to where I want the player hand to be, I am using the head CFrame only for its rotation, I want to make it relative to the character’s head instead of the headset bu


(Red = Headset CFrame, Green = Remote CFrame)

i’ve tried doing;
targetPos = value:ToObjectSpace(char.Head.CFrame).p
(value is the CFrame of the RightHand controller)
and that does make some difference, but not enough

I’m not sure how to go on about this, if you have some ideas or you done something like this before,
I’d really appreciate the help

Sorry for explaining it terribly, I really dont know how I could explain it better, I tried to be as descriptive as I could, feel free to ask any questions.

1 Like
local original = --the part it is relative to
local relative = --the thing that is relative to the part
relative.CFrame = original.CFrame * CFrame.new(0,0,2) -- Makes it 2 studs infront of the original
1 Like