Ohhh lol I just realized the photo you sent wasn’t doors. I thought the photo was what you want LOL. Anyways you could make the rootpart face the camera. But, for this you would need to have a tool none animation.
Ahh well sorry for making this post so long with my misunderstandings.
So you will want to make the root and the arm point towards the camera. You can do this by doing something like this:
local RunService = game:GetService("RunService")
local character = script.parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local Camera = workspace.CurrentCamera
local Head = character:WaitForChild("Head")
local Neck = Head:WaitForChild("Neck")
local Torso = character:WaitForChild("UpperTorso")
local Waist = Torso:WaitForChild("Waist")
local Humanoid = character:WaitForChild("Humanoid")
local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
local NeckOriginC0 = Neck.C0
local WaistOriginC0 = Waist.C0
Neck.MaxVelocity = 1/3
local humanoid = character:WaitForChild("Humanoid")
local torso = character:WaitForChild("UpperTorso")
local leftArm = character:WaitForChild("LeftUpperArm")
local rightArm = character:WaitForChild("RightUpperArm")
local rightShoulder = rightArm:WaitForChild("RightShoulder")
local leftShoulder = leftArm:WaitForChild("LeftShoulder")
local camera = game.Workspace.CurrentCamera
local currentC0Left = leftShoulder.C0
local currentC0Right = rightShoulder.C0
local updateSpeed = 0.5/2
function getPoint()
local r=Camera:ViewportPointToRay(mouse.X, mouse.Y,1337);
return r.Origin+r.Direction;
end;
RunService.RenderStepped:Connect(function()
local CameraCFrame = Camera.CoordinateFrame
if character:FindFirstChild("UpperTorso") and character:FindFirstChild("Head") then
local TorsoLookVector = Torso.CFrame.lookVector
local HeadPosition = Head.CFrame.p
if Neck and Waist then
if Camera.CameraSubject:IsDescendantOf(character) or Camera.CameraSubject:IsDescendantOf(player) then
local Point = getPoint();
local Distance = (Head.CFrame.p - Point).magnitude
local Difference = Head.CFrame.Y - Point.Y
Neck.C0 = Neck.C0:lerp(NeckOriginC0 * CFrame.Angles(-(math.atan(Difference / Distance) * 0.5), (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 1, 0), 0.5 / 2)
Waist.C0 = Waist.C0:lerp(WaistOriginC0 * CFrame.Angles(-(math.atan(Difference / Distance) * 0.5), (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 0.5, 0), 0.5 / 2)
end
end
end
local camCF = camera.CoordinateFrame
local distance = (character.Head.Position - camCF.p).magnitude
if distance <= 2 and humanoid.Health ~= 0 then
rightShoulder.C0 = rightShoulder.C0:lerp((camCF * currentC0Right * CFrame.new(0,-1.5,0)):toObjectSpace(torso.CFrame):inverse() , updateSpeed)
leftShoulder.C0 = leftShoulder.C0:lerp((camCF * currentC0Left * CFrame.new(0,-1.5,0)):toObjectSpace(torso.CFrame):inverse() , updateSpeed)
else
rightShoulder.C0 = currentC0Right
leftShoulder.C0 = currentC0Left
end
end)
If you need me to explain the code I can. Place this in starter character scripts. Although you should probably alter it and put it somewhere else.
Also one more thing to note there will some slight delays and you can fix this with dt. I can also help you on that if you need.