I want to reset my Neck.C0 and Waist.C0 to go to the original position when seated so it doesn’t look weird. I can’t seem to achieve this. My code:
game:GetService("RunService").RenderStepped:Connect(function()
local CameraDirection = HumanoidRootPart.CFrame:ToObjectSpace(Camera.CFrame).LookVector
if Humanoid:GetState() == Enum.HumanoidStateType.Seated then
Neck.C0 = NeckC0
Waist.C0 = WaistC0
else
if Neck and Waist then
TweenService:Create(Neck, RotateInfo, {C0 = CFNew(0, NeckC0.Y, 0) * CFAng(0, -MAsin(CameraDirection.X) / 1.5, 0) * CFAng(MAsin(CameraDirection.Y) / 1.5, 0, 0)}):Play()
TweenService:Create(Waist, RotateInfo, {C0 = CFNew(0, WaistC0.Y, 0) * CFAng(0, -MAsin(CameraDirection.X) / 1.5, 0) * CFAng(MAsin(CameraDirection.Y) / 1.5, 0, 0)}):Play()
end
end
end)
I tried using Humanoid:GetState() yet it still doesn’t work. Any possible solutions?