Camera "System" Framework (Formerly Known as "CameraLock")

Warnings

CameraLock has been uploaded before, if you were wondering.

THIS IS NOT A FINSIHED RESOURCE. I am actively updating and debugging almost every day. This message WILL BE REMOVED once I am done and this resource is in a bug-less state.

Features

  • Modular Structure
  • Proper Life Cycle
  • Simple to use, Good expandability
  • Highly Customizable
  • Utility Camera Methods

Documentation

Main Module

CameraLock:Start()Starts Module and Life Cycle. Enables Components, and Dependencies (Can only be called once).

CameraLock:Enable()Enables Explicitly Called Components, and Dependencies, Sets up character connections, and starts Camera Offset and Mouse behavior RunService connections.

CameraLock:Disable() – Disables Explicitly Called Components, and Dependencies. Cleans Maid(s). Resets Explicitly Called Components and Dependency’s. (Shouldn’t be called).

CameraLock:EnableAllComponents()/CameraLock:EnableAllDependencies() – Enables all Components/Dependencies. Calling their :Enable() Function and using “Promise” to resolve any errors. (Checks for .CheckForStartFunction (Exclusion) ), (Accepts Custom folder).

CameraLock:DisableAllComponents()/CameraLock:DisableAllDependencies() – Disables all Components/Dependencies. Calling their :Enable() Function and using “Promise” to resolve any errors. (Checks for .CheckForDisableFunction (Exclusion) ), (Accepts Custom folder).

CameraLock:EnableComponent()/CameraLock:EnableDependency() – Enables Component/Depedency (Singular) Calling their :Enable() Function and using “Promise” to resolve any errors. (Checks for .CheckForStartFunction (Exclusion) ).

CameraLock:DisableComponent()/CameraLock:DisableDependency() – Enables Component/Depedency (Singular) Calling their :Disable() Function and using “Promise” to resolve any errors. (Checks for .CheckForDisableFunction (Exclusion) ).

CameraLock:SetCameraDefaults()Sets Camera Defaults.

Dependencies

MouseDependency

MouseDependency:SetMouseBehavior() – Sets Mouse behaviour, Sanity checks

MouseDependency:SetMouseIcon() – Sets Mouse Icon, Sanity checks

MouseDependency:SetSensitivity() – Sets Mouse Sensitivity, Sanity checks

CameraSubjectDependency

CameraSubjectDependency:SetCameraSubject() – Sets CameraSubect

CameraSubjectDependency:SetCameraSubjectToOrignal() – Sets CameraSubject to original (On Run) Camera Subject

CameraSubjectDependency:LerpToCameraSubjectPosition() – Lerps (Smoothly Moves) Camera’s position to your new CameraSubject

FieldOfViewDependency

FieldOfViewDependency:CreateFieldOfViewTween() – Returns a new Field of view Tween

FieldOfViewDependency:SetFieldOfViewToBase() – Sets field of view to the base (On Run) field of view

FieldOfViewDependency:PlayFieldOfViewTween() – Simpler CreateFieldOfViewTween() except it plays and doesnt return

FieldOfViewDependency:PlayTwofoldFieldOfViewTween() like PlayFieldOfViewTween() except it creates two back to back field of view tweens

Other

Settings

Under the Main module, there is a “Settings” Module. Please edit this as you like to change how the modules life cycle/ functionality works.

State

Under the Main module, there is a “State” Module. This shouldnt be directly required.

Types

Under the Main module, there is a “Types” Module. This shouldnt be directly required.

Events

There are Events that you can :Connect() to in the Main Module. These are: OnStartedComplete, OnEnabled, OnDisabled. These serve as a “Getter” for things you may do.

RbxUtil

Under the Main module, there is a “RbxUtil” Folder. This is for main module. None of these modules under this folder should be required.

Modules

Under the Main module, there is a “Modules” Folder. This folder is basically just “Util” like CameraShaker. Put any module here and you can explicitly required it under self.Modules In the :Start() function of the module. This allows “Easy” access to it. (Feature will be enhanced later)

Components/Dependencies

Under the Main module, there is a “Components” and “Dependencies” Folder. Put your desired component/Dependency here. Have a (Optional) :Enable() and Disable() Function. Ive loosely “Typed” Depedencies as none effects like shiftlock. And Components as Effects like Camera Tilt.

LifeCycle

CameraLock:Start()Neccesary for proper use. Constructs “self” and Components, Dependencies, Modules, Events, (Can only be called once)

CameraLock:Enable()Has to be called AFTER CameraLock:Start(). Refer to "Documenation- Main Module-CameraLock:Enable() ".

CameraLock:Enable()Has to be called AFTER CameraLock:Start(). Refer to "Documenation- Main Module-CameraLock:Disable() ".

Releases

Please download the LATEST version.
V1. CameraLockV1
V2. CameraLockV2

Installation

  1. Drag somewhere that can be accesed from the client Ex: ReplicatedStorage
  2. Require/Start from STARTERPLAYERSCRIPTS
  3. Disable "EnableMouseLockOption"In STARTERPLAYERSCRIPTS

Example Code:

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local CameraLock = require(ReplicatedStorage.Camera)
CameraLock:Start()

Test Place

Is this a Good Resource?

  • Yes
  • No

0 voters

6 Likes

I’m grabbin this. Thanks for sharing!

V2 is out Now! This completely overhauls this module as a FRAMEWORK. For YOUR camera effects/systems.

Please check the updated topic post for more information on V2.


There are premade effects. Here are some showcases

Velocity Offset

External Media

Custom Shiftlock

External Media

Camera Tilt

External Media

Let me know if you find any bugs/ want any features!

Goodluck!