Where to start with making an FPS camera like Doors?

I think we can all agree that the first person camera in Doors is very well done and I’d like to replicate the same system, but I have no idea how to start, roblox already handles the movement and camera for you with the PlayerModule that goes into your player instance. Should I delete or edit or better yet, is there any good quality open source first person camera scripts out there?

2 Likes

Doors uses the default PlayerModule, just edits the camera behaviour with a script and the CurrentCamera CameraType set to Scriptable

Lerping & Springs is your best bet for something like Doors. That’s typically what I do when I write custom camera code. You could fork the camera module and go from there but I recommend you write your own camera code without relying on the default roblox camera scripts.

1 Like

Could you please explain me what springs are, I have seen that word get tossed around in cameras.

Here’s a good visualization of what a spring looks like. I’m not sure how to explain it but it sort of ‘overshoots’ the target destination a little bit then goes back to the target destination, hence creating the spring like effect.

5 Likes

I see, thanks for the visualization, but how would I apply this to the camera’s CFrame to give it that springy effect? I really cant wrap my head around how to do it, any help would be hugely appreciated.

You can start by trying to figure out how to adjust this number that overshoots and putting that in a rotational CFrame.

Something like an fps view model for example, putting the value in CFrame.Angles or CFrame.fromAxisAngle also uses @AxisAngle module that @ContemporaryMoment put as the desmos graph I believe.

However you could need a method of getting the camera “true” CFrame before any effects such as shake or aformentioned spring is applied. Or else the camera will shake forever which I have experienced. However I will let you try this on your own perhaps you have your own method.

Something like the example script here which tracks the rotation through mouse delta.

https://developer.roblox.com/en-us/api-reference/function/UserInputService/GetMouseDelta

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.