# Realistic camera with smooth movements

Lately I’ve been working on a script that makes the player experience more enjoyable:

The requested experience is required for the player to be in first person, but as we all know the roblox service itself on which it qualifies as “FirstPersonLocker” is far from realistic, so myself and many other content creators are confused to create one. camera that qualifies the player to go both ways with camera smoothing along with the body appearing to make other tools that qualify like:

1. Flashlight
2. Animations
3. Hand tools

If you know more about it, please discuss it below in the comments so we can help each other and come up with a solution where we have a smooth and realistic camera movement.

Game: DOORS
Game developer credits: LSPLASH

An example I ended up finding about my topic above:

9 Likes

One possible way is to make the camera in the head and use a RenderStepped event to keep it there, and when the player walks you could play an animation that sways the entire body. Also you could change the orientation of the head depending on the player’s mouse’s position.

3 Likes

I do believe there is a better way of doing this, you could change the part the camera follows within PlayerModule>CameraModule>BaseCamera. There, you could find “bodyPartToFollow” and change that to be the head rather than the humanoidrootpart however I am unsure on how well this would work.

The closest thing I was able to make to the video above was to use DuruTeru’s first person script alongside a head turning script.

2 Likes

Could you explain better ? I still couldn’t understand

I see a lot of people wanting to replicate this effect, however it’s not as hard as you may expect.

it’s broken down actually into many little pieces.

• Fov changes based off velocity(just use dot product w/ veloc and camera.lookvec)
• A bobble effect when you move(you can achieve this by tweaking the camera offset in humanoid, and here’s the equation i used for the Y-axis:
``````currentTime = tick()
local bobbleY = math.abs(math.sin(currentTime * BobbleIntensity)) * BobbleDistance
``````

,then you can put in into a vector3 and lerp it to camera’s offset)

• A roll effect that is very similar to the fov and bobble by lerping using dot product output and modifying it to your liking so it can affect the Z axis
• Local Transparency modifier to change the transparency in the body OR you can use a cloned rig of the player
• Finally changing the camera offset to look realistic so it’s not positioned above your HRP and actually positioned at your head at all times

For the 3rd person effects you simply use some basic trig to adjust the joints to follow your mouse/camera lookvector, when coding if possible break it down as simply as you can. for example take on the X-Y axis before thinking about the Z, and in some cases you don’t even need the Z.

(PS someone who i reference a lot who I feel explains some of these effects with the most in-depth detail is a youtuber named: Okeanskiy)

I hope this helps, and good luck with creating your dynamic first person project!

15 Likes

Hey, using a similar script, I encountered a problem : my body parts are shaking too so when i hold a tool, it looks bad. Do you know how to fix this problem ?
Thank you