About Enhanced Camera System
Using original “Shift Lock” camera mode from Roblox might sometime cause wall-clipping issue when character standing too close to a wall or a big object. In order to get rid of the wall-clipping is to create a custom camera script for achieve a better “Shift Lock” mode and this is the reason I wanted to create this module.
Enhanced Camera System is a user-friendly, multi-functional camera module that can be easily implemented into any game and act as an alternative method to achieve a customizable over-the-shoulder camera with proper collision detection.
- Easy Setup
- Customizable
- Smooth Transition
- Mobile Compatible
- Collision Detection
- Compatible to most games (Using default Roblox camera script - CameraType.Custom)
Enhanced Camera System Module
The module is placed under the tool for easy plug & play demonstration and it should be configured as below setup for further application - or you might find the module here: GitHub
https://www.roblox.com/library/6562513266/Enhanced-Camera-System
Update Log
- Redefining “local Character = Player.Character” in all functions to ensure overall module stability
- Added a separate function to toggle mouse icon
- Moved RaycastParams out of RenderStep function to improve performance
- Added mouse sensitivity adjustment in different camera modes for better controls
Module Setup
- Place the module into StarterPlayerScripts
- Put below code into LocalScript anywhere you would like to switch camera modes from
local Players = game:GetService("Players") local Player = Players.LocalPlayer local ECS = require(Player.PlayerScripts:WaitForChild("EnhancedCameraSystem"))
MouseIcon(Status)
To toggle mouse icon
ECS:MouseIcon(true) ECS:MouseIcon(false)
MouseLock(Status)
To toggle moving-camera-without-right-clicking mode as well as locking mouse at center of screen (Is there a better name to describe this?)
ECS:MouseLock(true) ECS:MouseLock(false)
Alignment(Status)
To toggle character alignment that facing forward as the camera angle
ECS:Alignment(true) ECS:Alignment(false)
CameraMode(Mode)
To toggle different camera modes as well as resetting camera
ECS:CameraMode("Aim") ECS:CameraMode("FirstPerson") ECS:CameraMode("Scope") ECS:CameraMode("Reset")
Usage Sample
A simple script that put under StarterCharacterScripts to toggle over-the-shoulder camera when holding down right mouse button
local Players = game:GetService("Players") local Player = Players.LocalPlayer local ECS = require(Player.PlayerScripts:WaitForChild("EnhancedCameraSystem")) local UserInputService = game:GetService("UserInputService") UserInputService.InputBegan:Connect(function (input) if input.UserInputType == Enum.UserInputType.MouseButton2 then ECS:MouseLock(true) ECS:Alignment(true) ECS:CameraMode("Aim") end end) UserInputService.InputEnded:Connect(function (input) if input.UserInputType == Enum.UserInputType.MouseButton2 then ECS:MouseLock(false) ECS:Alignment(false) ECS:CameraMode("Reset") end end)
Test Place & Application
You might try the camera system here at the test place below
https://www.roblox.com/games/6211585678/
Notes
Thank you so much for your time! I just started learning about scripting not long ago and this is my first attempt to create a module script. I hope this small module script could assist your projects. Feel free to let me know for any questions, suggestions or encountered bugs.