Help with VR torso

So I’m trying to make a VR character and I already have the head and hands done but I am kind of stuck on the torso.

What I want to achieve:




I want to make a torso that is below your head and faces the same direction as your head. Would I need to use the LookVector of the character’s head?

2 Likes

Perhaps weld the torso to the head so it moves and rotates with the head?

You can extract the Y rotation of the head, and use it to create a new cframe without any other rotation. This is pretty much how im doing it in my game.

local Head = workspace.Head
local Torso = workspace.Torso

game["Run Service"].Heartbeat:Connect(function()
	local _, Y, _ = Head.CFrame:ToOrientation()
	Torso.CFrame = CFrame.new(Head.Position + Vector3.new(0, -2, 0)) * CFrame.Angles(0, Y, 0)
end)

hi! i dont know exactly what you want to acheive, but wouldnt you want the torso to be independent from the head? if the user turns the head, the torso shouldnt move according to my preferences, but its up to you. however if youve decided that you do want to make move with the head, you could create a function that updates the torso and bind it to renderstep. ex:

local function updateTorso()
   torso.CFrame = CFrame.LookAt(torso.Position, torso.Position + head.CFrame. LookVector)
end
game:GetService("RunService"):BindToRenderStep("torsoUpdate", 1, updateTorso)

you could change this line

torso.CFrame = CFrame.LookAt(torso.Position, torso.Position + head.CFrame. LookVector)

to only account for the y rotation (left and right) by making it this:

torso.CFrame = CFrame.LookAt(torso.Position, torso.Position + head.CFrame. LookVector * Vector3.yAxis)