I’m trying to get a realistic breathing effect in First Person
I tried attaching the camera to the players torso or head, it did work, but not in the way intended. It makes the player’s body visible and makes the camera controls all weird.
local player = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera
cam.CameraSubject = player.Character.Head
cam.CameraMode = Enum.CameraMode.LockFirstPerson
Is there a better way to make the camera have a breathing effect?
I’m not good with visualizing math as others, an example of this would be games like Call of Duty. The camera bobs in a breathing motion, even when sitting idle.
For my GCC game, I looped using CameraOffset to move the camera up/down to get a breathing/stride movement, you might be able to use this to accomplish what you want, too.
I’m not really sure what to do about choppiness, sorry. Really the only experience I’ve had with CameraOffset is for that game, and I was rushing to make that in about the last week and a half of the contest so I basically found something that worked, made it as quickly as possible, and moved on.
If the camera gets choppy, just use the offset as a placeholder, but then use cam:Interpolate(CamPos,CamFocus,timeBetween) where the camera is the offset, and the camfocus is where the mouse is, and also the timeBetween is really small, like .03. This makes it really smooth.