Cool, does it have a smooth popper/obstruction handling thing?
It has obstruction handling but I’m not sure what you mean by smooth popper. Can you private message me?
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?
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.
SUGGESTION:
Add an option to make player rotates with camera!
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.
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)
If only I found this yesterday… The basics work flawlessly!
Thanks for this suggestion. I added character interpolation now.
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.
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.
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.
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()
There is still some work to be done. You need to update it so it isn’t locked to the framerate.
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?
The camera FOV and camera movement transitions (Like switching shoulders).
When i enable it and disable and enable it again the character rotation/movement not working?
Fixed it. Thanks for informing me about the issue.