CameraService 
A New Camera for a New Roblox.
Just a heads-up that this is my first-ever open-source for any of my programming projects, so hopefully I’m doing this right.
For the past few months, I, along with my development team, have been working on an ambitious MMORPG project on the Roblox platform. A key theme we decided early on was to focus on immersion and realism, and as a result, I decided to create a custom camera system that serves that purpose. And as seen by this post, I’ve decided to open-source it, letting developers of all kinds be able to implement new, breathtaking camera views into their games and experiences in just a few lines of code!
The Features
The list of features goes on and on, some of which include:
- Different, customizable properties that developers can play around with and implement, including the camera’s smoothness, zoom, offset from the part it’s focusing on, and more.
- Seamlessly transitioning between different camera views (first-person, third-person, shift-lock, etc.), and letting you create your own!
- Smooth camera movements, rather than Roblox’s usual instantaneous movements
- The ability to tilt the camera with ease, opening the door to advanced-like camera manipulation to beginners.
- Properties that let you enable aesthetically appealing effects on the player’s character, such as having their body follow the mouse.
- Shaking camera effects that can be used for a multitude of purposes.
- Ability to lock camera panning on the X and Y axes.
- Compatible on laptop, mobile, and console.
Demonstrations
Here are videos showcasing some of CameraService’s features and built-in camera views:
You can see a tech demo of CameraService for yourself here.
Third Person
CameraService’s default third person camera view is in sharp contrast with Roblox’s traditional camera, providing additional features such as smooth movements, and character rotation based off mouse input.
First Person
This system provides built-in first person, already doing the work of restricting zoom. Like third person, there is more smoother movements. Additionally, a FirstPersonVariant is also present as another camera view, which allows you to see your character’s own body while in first-person mode.
Shift Lock
CameraService supports a camera view that imitates shift lock’s offset. Using the API, you, the developer, are able to customize the smoothness, offset, and much more in addition.
Custom Views
CameraService enables you to create your own camera views, allowing for what would’ve been tedious hours of camera manipulation programming to be condensed into creating something like this in just a couple minutes!
Shaking and Tilting
These two are embedded as methods that can be called through CameraService.
Documentation
You can now find all documentation on the CameraService API through its own webpage: CameraService
A full conversion to strict typecasting in Luau is planned, for standardization!
Examples
Say you wanted to recreate the cinematic camera effect seen at the very top and in demonstrations. To create something like that, your program would look like:
local CameraService = require(script.Parent.WhereverThisIsPlaced.ShouldBeOnTheClient)
local information = {
Smoothness = 10,
CharacterVisibility = "All",
MinZoom = 10,
MaxZoom = 10,
Zoom = 10,
AlignChar = false,
Offset = CFrame.new(),
LockMouse = false,
BodyFollow = false
}
CameraService:CreateNewCameraView("Cinematic", information)
CameraService:SetCameraView("Cinematic") --> Tada!
CameraService:ChangeFOV(90, false) --> You could also add a bit more with changing the FOV.
And let’s say you wanted you wanted to just simply have players start in CameraService’s third-person when they join. It’s simply a matter of just a couple lines.
local CameraService = require(script.Parent.WhereverThisIsPlaced.ShouldBeOnTheClient)
CameraService:SetCameraView("ThirdPerson")
--> Other built-in camera views include: FirstPerson, FirstPersonVariant, and ShiftLock
--> And if we wanted to spice it up, and have it feel like an explosion?
--> When the character steps on a certain part, it can go like this:
local player = game.Players.LocalPlayer
local debounce = false
workspace.ExplosionPart.Touched:Connect(function(hit)
if not debounce and hit and player and player.Character and hit.Parent == player.Character then
debounce = true
CameraService:Shake(1, 5) --> Shakes heavily for 5 seconds.
end
end)
Notes:
- On 120+ FPS for R6 rigs, there may be a slight jitter for certain movements, due to the camera’s frame-of-referencing + how R6 rig physics handle movement. If this poses concern, DM me and we can go over possible alternatives/solutions.
- Due to UserInputService not recognizing the classic (not dynamic) Roblox thumbstick on mobile devices as a
GameProcessedEvent, there may be some unusual behavior when using CameraService on mobile IF using the old thumbstick (the current dynamic thumbstick has no issues).
Where to Obtain CameraService
- Roblox Creator Store Page
- Technical Document (If you wanna read up on the specifics!)
- GitHub
- CameraService Website
Latest Release (v2.4.0):
You can also contact me on Discord at @lugical.me and on Twitter.
I’m always looking to help showcase & support any games using CameraService. If you are, feel free to let me know, so I can shout you out in the post!
hint hint roblox it’s been a couple years
to an experience! Really love seeing camera resources released - I think it’s a niche that a lot of people struggle with and consequently avoid, despite the fact that it can really make a game pop!
