I want my skinned mesh character’s spine bone to rotate in proportion to how much the player is looking up or down. To do this with normal characters it usually involves CFrame–so how would you go about doing it with bones and their orientation? I also do not think doing this on the client would replicate to the server, so any ideas on that would also be great.
I am not asking for an entire script since that would be ridiculous, but some ideas would be super helpful!
Bones should also use the CFrame of the attachments like in the post below, so you should be able to apply the same thing similar to Motor6D CFrame transformations.
I would try using code from Motor6D and applying it to a bone.
For a Motor6D the CFrame offsets are C0 and C1 which are relative to the Part0 and Part1 respectively.
For a bone the CFrame offsets are just the attachment0.CFrame and attachment1.CFrame relative to the part it is attached attachment0.Parent and attachment1.Parent respectively.
Was able to find a simpler solution. Here’s the code in case anyone comes across a similar problem.
local runservice = game:GetService("RunService")
local player = game:GetService("Players").LocalPlayer
local cam = workspace.CurrentCamera
local bone = player.Character.HumanoidRootPart.Bip001['Bip001 Pelvis']['Bip001 Spine']['Bip001 Spine1']
runservice.Stepped:connect(function()
local camPos = Vector3.new(0,0,180 - (cam.CFrame:ToOrientation() * 30))
bone.Orientation = camPos
end)