I haven’t been able to find an actual helpful post about this and yes I’ve looked around for solutions.
What’s happening is the player falls and once the HumanoidStateType changes to falling (the detection of the new hum state works) it’s supposed to freeze the camera in a way. What I mean by this is the camera is supposed to follow the player like it would normally, but prevent you from moving your camera at all.
Set camera.CameraType to Enum.CameraType.Scriptable
Calculate offset between camera world position and player’s character (cam.Position - char.PrimaryPart.Position)
Use a while loop with RunService.RenderStepped:Wait() and summ the character position with the offset (cam.Position = char.PrimaryPart.Position + Offset)
You can’t ask for scripts on scripting support, you can only get help with scripts you have.
That meaning, you may need to try and understand what @g1mmethemoney said and put that into a script. If that doesn’t work, you can ask for help with the script you made.
So I’ve done something similar here is my code. make sure to change the camera to scriptable.
function FocusNPC()
goal=CFrame.new(Vector3.new(Root.CFrame),Vector3.new(target.Parent.Head.CFrame))
–local goal
Camera.CFrame = Camera.CFrame:Lerp(goal, .0333)
This can be achieved by checking the HumanoidState of the player and see if they’re falling!
Here’s my approach
Example
local RunService = game:GetService("RunService")
local function updateCamera()
local player = game.Players.LocalPlayer
local character = player.Character
if not character then return end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end
if humanoid:GetState() == Enum.HumanoidStateType.Falling then
-- Freeze camera movement
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = nil
else
-- Update camera position and orientation
local camera = workspace.CurrentCamera
local head = character:FindFirstChild("Head")
if not head then return end
local xAngle = 0 -- Modify as needed
local yAngle = 0 -- Modify as needed
local cameraPosition = Vector3.new(0, 2, -5) -- Modify as needed
local startCFrame = CFrame.new(head.Position + Vector3.new(0, 2, 0))
local cameraCFrame = startCFrame * CFrame.Angles(math.rad(xAngle), math.rad(yAngle), 0) * CFrame.new(cameraPosition)
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = head
camera.CFrame = cameraCFrame
end
end
RunService.RenderStepped:Connect(updateCamera)
In my example, the updateCamera() function is called on every render step, which is about 60 times per second. Inside the function, we check if the player is falling and freezes the camera movement by setting the CameraType to Scriptable and clearing the CameraSubject. Otherwise, it’ll update the camera’s CFrame and restores the CameraType to Custom and sets the CameraSubject to the player’s head.
All settings are configurable and bound to testing to your needs.