How do you make a smooth camera like in DOORS?

My English is very bad, I’ll try to spell it out as best I can

Hello! I am developing a project similar to DOORS, and no matter how many times I tried to achieve this camera effect I failed.

This video shows what I’m talking about, if I move the mouse in the game it happens smoothly, not as abruptly as in the standard Roblox camera

Can you tell me how to achieve this effect?

Thank you for your attention!

3 Likes

Linear interpolation using mouse delta as input and output as relative camera offset movement from previous frame.

Provide more details or existing code if you want extra help, I can’t be bothered to debug code when given no code to debug.

3 Likes

Can you please give me at least a sample code?

1 Like

I suggest trying to do it by yourself first before being “spoon feed”. Search on google on how to do it.

Otherwise you wont really progress as a programmer/scripter

2 Likes

No, because I do this and then spend 30 minutes trying to debug issues because of errors that occur unknown to me in my testing enviroment.

1 Like

Yes, I guess you’re right, I’ll try to look

1 Like

Okay, thanks anyway for responding.

1 Like

In addition to what @xZylter said, I can show an example you can work on. In the toolbox, if you type smooth camera, you’ll find a local script called “Smooth First Person Camera [bundle]”, published by @DuruTeru. Despite being last updated in 2020 and containing some outdated code combined with some bad practices, the heart of the code is still very relevant. I’ve successfully written efficient but similar code for smooth camera before.

As xZylter also mentioned, you bind the camera to RenderStep (RunService:BindToRenderStep()) and use UIS.InputChanged, which passes inputObject.Delta. The delta may be modified and used to construct a new camera CFrame.

Seeing that you take bad practices into account (including modifying transparency of all character parts and getting UserInputService each frame prior to screen drawing), the logic still applies, no matter if you’re creating a first person or over the shoulder camera.

The angle calculation part may seem confusing at first, but you’ll see that it can be broken into smaller segments. Modify input delta, construct new angle X (up-down), construct new angle Y (left-right), create new CFrame, multiply it by head’s position, multiply by the custom offset. Tada!

4 Likes

For some reason I could not find this model in the toolbox, but now I got it, almost immediately figured out what’s what. Thank you!

2 Likes

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