Over-The-Shoulder Camera System

Cool, does it have a smooth popper/obstruction handling thing?

16 Likes

It has obstruction handling but I’m not sure what you mean by smooth popper. Can you private message me?

9 Likes

Thank you soo much, been looking for this soo long! Also, can you make it so the cam won’t be able to go upside down and have limits?

6 Likes

Wow! This is a pretty great system, I love that you focused on customization! And yeah, as @AzimuthBecameReal pointed out, you can do 360s with the camera:

https://i.gyazo.com/1d6aa70c687f4b39dfa5f078b84aa162.mp4

You could add “dead band” constants that developers can customize. These values would just limit how far down or up a player can move their camera.

9 Likes

SUGGESTION:
Add an option to make player rotates with camera!

4 Likes

Oops. I missed that. It is fixed now.

Thank you for this suggestion. I have limited the vertical angle now.

That’s a very nice suggestion. I have added it now (It’s called CameraFollow).

I have updated the original post with the new stuff.

6 Likes

You might want to add some interpolation to the character rotation. Something like

local alpha = .15 
rootPart.CFrame = rootPart.CFrame * CFrame.Angles(0, diffAngle * (alpha ^ (1 / (updateTime * 60))), 0)
7 Likes

If only I found this yesterday… The basics work flawlessly!

4 Likes

Thanks for this suggestion. I added character interpolation now.

4 Likes

Thanks for this. Looking good.
A minor thing is that when you stand with your back up against a wall the camera view will be blocked by the player. It would be nice if the camera can never be blocked by the player.

It’s a minor thing in this demo but I think it could cause annoyance to the player if you for example made some kind of arena shooter with lots of obstacles that could potentially cause the camera to be blocked.

4 Likes

Do you have a suggestion to solve that issue? I’m thinking if turning the player somewhat transparent in that scenario would be good enough.

3 Likes

Sadly I don’t have a solution regarding how to code it. I haven’t worked much with cameras yet.

But I do know that there is an example made by Roblox that have this figured out. It’s the Battle Royale Demo that can be found here: Battle Royale | Documentation - Roblox Creator Hub

The entire game can be downloaded and there is also a playable demo. Perhaps you can look at their camera script and get a few pointers. It also have the added feature of changing the cross hair when zooming in.

5 Likes

I am not very sure how to implent it O-o
image


I have never ever been enabling a module script :confused:

4 Likes

You need to use require() call to use ModuleScripts first.
You need to rewrite your code like this to use it:

local OTS_CAMERA_SYSTEM = require(script["OTS Camera System"])
OTS_CAMERA_SYSTEM:Enable()
3 Likes

There is still some work to be done. You need to update it so it isn’t locked to the framerate.

2 Likes

What do you mean specifically?

I’m updating the camera before the new frame is rendered (which I believe is best practice) and I am using :GetMouseDelta() (which I believe gets the mouse movement between frames).

Which part do you think needs to become independent of the frames?

3 Likes

The camera FOV and camera movement transitions (Like switching shoulders).

2 Likes

When i enable it and disable and enable it again the character rotation/movement not working?

3 Likes

Fixed it. Thanks for informing me about the issue.

4 Likes

It looks great in-game, yet when I use the provided model I’m met with Errors.

I did the localScript as instructed:

local OTS_CAMERA_SYSTEM = require(script["OTS Camera System"])

OTS_CAMERA_SYSTEM:Enable()

7 Likes