One of the strategies I’ve thought of is to position the camera slightly in front of the head, so you wouldn’t see the neck.
This is the code I have got so far
while wait(0.1) do
local camera = workspace.CurrentCamera
if (char.Head.CFrame.p - camera.CFrame.p).Magnitude < 1 then
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = char.Head.CFrame + Vector3.new(1,0,0)
end
end
But what ends up happening is the camera gets stuck in place when you go into first person.
How could I add it so while your running it would change? It is currently like this, you can still see the neck. robloxapp-20221120-1914530.wmv (1.0 MB)
function IsFirstPerson()
return (char.Head.CFrame.p - camera.CFrame.p).Magnitude < 1
end
game:GetService("RunService").RenderStepped:Connect(function()
if IsFirstPerson() then
char:WaitForChild("Humanoid").CameraOffset = Vector3.new(0,0,-1)
else
char:WaitForChild("Humanoid").CameraOffset = Vector3.new(0,0,0)
end
end)
char:WaitForChild("Humanoid").Running:Connect(function(speed)
if speed > 0 and IsFirstPerson() then
char:WaitForChild("Humanoid").CameraOffset = Vector3.new(0,0,-2) --
end
end)
I think if you could just find a way to remove the flickering I could do the rest, I think its because of the animation, I was using ninja which tilts the torso forward
From what i’ve noticed Doors uses a specific running animation where
the head is hiding and, in the video you just showed me, the running animation
makes the whole body exposed in first person.
To fix the flickering, I used TweenService where instead of it setting
the Camera instantly it transitions it.
local TweenService = game:GetService("TweenService")
function IsFirstPerson()
return (char.Head.CFrame.p - camera.CFrame.p).Magnitude < 1
end
local Humanoid = char:WaitForChild("Humanoid")
local info = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.In)
game:GetService("RunService").RenderStepped:Connect(function()
if IsFirstPerson() then
local Tween = TweenService:Create(Humanoid, info, {CameraOffset = Vector3.new(0,0,-1)})
Tween:Play()
else
local Tween = TweenService:Create(Humanoid, info, {CameraOffset = Vector3.new(0,0,0)})
Tween:Play()
end
end)
char:WaitForChild("Humanoid").Running:Connect(function(speed)
if speed > 0 and IsFirstPerson() then
local Tween = TweenService:Create(Humanoid, info, {CameraOffset = Vector3.new(0,0,-2)})
Tween:Play()
end
end)