The issue I’m having, is that the camera when you go into first person, stays in one position where it doesn’t move.
What is happening:
What I want:
I already have a script, the issue is that the camera is somehow locked in first person where it doesn’t move at all, even when prompted in the script.
THE SCRIPT:
local Intensity = 10
local xMagnitude = .5
local yMagnitude = .5
local plr = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local player = plr.LocalPlayer
local cam = workspace.CurrentCamera
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
--//Setups
player.CameraMaxZoomDistance = 0
player.CameraMinZoomDistance = 0
--//Functions
function update()
local currentTime = tick()
if hum.MoveDirection.Magnitude > 0.5 then
local x = math.cos(currentTime * Intensity) * xMagnitude
local y = math.abs(math.sin(currentTime * Intensity)) * yMagnitude
local bobble = Vector3.new(x,y, 0.5)
hum.CameraOffset = hum.CameraOffset:lerp(bobble, .25)
return
end
hum.CameraOffset *= .75
end
RunService.RenderStepped:Connect(update)
Roblox’s default Camera script does not follow the head position in animations, and the script you provided only does a bobble. You’ll have to code that yourself or look it up on the internet, I don’t think it’s difficult.
I’ve looked everywhere, and they’re all really irrelevant and not the issue. What I’m wondering is, is maybe setting the camera subject to the player humanoid, although I wouldn’t know how to script that entirely.
From what i can understand, you want the camera to focus on the head during animations, the easiest way to do this is to set the CameraSubject to the head when the animation starts, then when it ends you set the CameraSubject back to the humanoid.