How to attach camera to head while playing an animation? (First person animation)

Hey there! My name is ShieldDevs, you can call me shield. I’m a scripter and a game developer.

So I was playing the game “TRESPASS [ACT III]” until I noticed the game’s animation once you load in.
It was also added to “The Mimic Book 2”

And I’ve tried many things before to achieve this, but I never found the way to do it.

I would appreciate it if you can help me!

Thanks,
Shield

1 Like

Hmm why don’t you just update the camera’s CFrame every frame through renderstepped?

local RunService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptabl
RunService.RenderStepped:Connect(function()
	camera.CFrame = player.Character.Head.CFrame
end)

Very basic code suggestion

3 Likes

I do remember trying this before, but I’ll give it another try, thank you.

All good? Did it work / do u need help

Yes, I am trying to use it in different ways now, thank you.

Now after adding an animation, the camera just breaks and starts spinning randomly.

Hmm could you send a video please

Or I guess you could try setting the Camera.CameraSubject to the head and putting it back to hrp when you are done