[UPDATE] Introducing EZCamera!

[Update]
(Added OffsetCFrame PresetParameter to both Still and Wobble presets, read through the PresetParams section below for details)


Hi

Are you frustrated at trying to get the camera to behave a certain way, or just annoyed at writing out tons of camera code in your scripts? Well this system should solve all of your concerns!

I have created a system here for the public that you may find really useful. It is an extremely simple camera manipulation system in one package that uses different presets to control the camera.

Letโ€™s say you want to make the camera orbit around a part after you touch it.
Instead of having to write all that camera code out in one script, you can simply just call the module.

Wobble preset sneak peek:
https://gyazo.com/4c2ab41adfc91c203389a006811f3abc
(Running Wobble preset on default settings)

In any ๐‹๐จ๐œ๐š๐ฅ ๐’๐œ๐ซ๐ข๐ฉ๐ญ (๐‘ถ๐‘ต๐‘ณ๐’€ WORKS FROM LOCAL SCRIPTS)
Start by requiring the module script. This will return to the local script all of the functions in this script.

local CameraModule = require(workspace.EZCam)

After that, you will be able to run this module with ease.



This module has two functions:

CameraModule:Start()

and

CameraModule:Stop()

๐‚๐š๐ฆ๐ž๐ซ๐š๐Œ๐จ๐๐ฎ๐ฅ๐ž:Start()

Arguments: (CFrameOrPositionOrInstance, PresetType, PresetParameters, Duration)


This function contains two optional arguments and two needed arguments.
The first two are the needed ones and the last two are optional. The first argument is the reference position/cframe/part (๐‘ช๐‘ญ๐’“๐’‚๐’Ž๐’†๐‘ถ๐’“๐‘ท๐’๐’”๐’Š๐’•๐’Š๐’๐’๐‘ถ๐’“๐‘ฐ๐’๐’”๐’•๐’‚๐’๐’„๐’†).

Argument #1: CFrameOrPositionOrInstance

It has different uses depending on the preset - for example, using Vector3.new(0, 10, 0) as the first argument with the Orbit preset will cause the camera to orbit Vector3.new(0, 10, 0), and using CFrame.new(30, 0, 0) with the Still preset will cause the camera to change directly to the CFrame of CFrame.new(30, 0, 0). Lets say you want to move your camera to your characterโ€™s headโ€™s CFrame. What we would type is:

CameraModule:Start(MyCharacter.Head.CFrame, โ€œStillโ€)

This will move the camera to my headโ€™s CFrame ONCE.
When the character walks away, the camera will stay where it was after it moved to the head.
If you want to camera to LOCK to the characterโ€™s headโ€™s cframe (continuously update to the headโ€™s cframe), simply write the head itself:

CameraModule:Start(MyCharacter.Head, "Still")

When you put in an instance, it lets the module know that you want to lock the cameraโ€™s cframe to that instance (update the cameraโ€™s cframe to that object repeatedly) until stopped.
Lets say we want to keep locking to the characterโ€™s headโ€™s CFrame but make it look a little nicer with a different preset:

CameraModule:Start(MyCharacter.Head, "Wobble")

What this will do is lock the cameraโ€™s CFrame to the head, but it will make it shake a little and give it a more realistic feel.

Argument #2: PresetType

The current usable presets in this version are:

Still
Wobble
LookAt
Orbit

Argument #3: PresetParameters

PresetParameters is basically just a way of saying customizable features.
Current PresetParameters for each Preset:

Still:
- OffsetCFrame โ€“ If you want to Lock to a part but have the camera move to the part + an offset, use this parameter.

Wobble:
- OffsetCFrame โ€“ If you want to Lock to a part but have the camera move to the part + an offset, use this parameter.
- WobbleSinSpeed โ€“ How fast it vibrates using sin
- WobbleCosSpeed - How fast it vibrates using cos
- WobbleSinSize โ€“ Total sin moving distance
- WobbleCosSize โ€“ Total cos moving distance

LookAt:
- AnchorPoint โ€“ The Position that the camera is in when it looks at the target

Orbit:
- OrbitSpeed โ€“ How fast the orbit is around the subject
- OrbitHeight โ€“ How high it orbits above the subject
- OrbitDistance โ€“ How far it orbits from the subject
- IsReversed โ€“ Determines if the rotation direction is reversed from the default rotation direction

Lets say that we have the camera currently orbiting around a part.

CameraModule:Start(workspace.MyPart, "Orbit")

What if we want to change the speed at which it rotates? Well, thankfully, there is a property called OrbitSpeed for the Orbit preset.
How we would go about changing the speed is to create a PresetParams variable. We will then make this the 3rd argument when calling the Start() function.

local PresetParameters = {
	OrbitSpeed = 10;
}
CameraModule:Start(workspace.MyPart, "Orbit", PresetParameters)

Now, the orbit will be 10 times as fast as the default orbit.

Lets say we also want to make it rotate in the other direction.

We see that there is a method called IsReversed for the Orbit preset, so we are able to do this easily:

local PresetParameters = {
	OrbitSpeed = 10;
	IsReversed = true;
}
CameraModule:Start(workspace.MyPart, "Orbit", PresetParameters)		

Now, the camera will orbit around the part 10 times as fast as default and the other direction from default.

Remember though, inside a table, you need to finish each line with either a semicolon ( ; ) or a comma ( , ) otherwise it will error (unless it is the last value).

local PresetParameters = {
	OrbitSpeed = 10 -- bad
}		
local PresetParameters = {
	OrbitSpeed = 10; -- good
}

Argument #4: Duration

All what Duration does is after the amount of time (in seconds) has passed, it will move the camera back to its original position (your character).
Lets say we want to make the camera orbit a part, but after 5 seconds, the module stops and the camera returns to your character.

CameraModule:Start(workspace.MyPart, "Orbit", PresetParameters, 5)

And what if we want to add a duration but leave the PresetParameters argument blank?
Well, very easily we could just type:

CameraModule:Start(workspace.MyPart, "Orbit", nil, 5)

Typing nil or {} for the 3rd argument will ensure that everything is at its default settings.
Also, keep in mind that if you want it to never expire and go back to your character, just leave it blank or put -1.

๐‚๐š๐ฆ๐ž๐ซ๐š๐Œ๐จ๐๐ฎ๐ฅ๐ž:๐’๐ญ๐จ๐ฉ()

Arguments: None


This function is pretty self explanatory:
If any camera manipulation from this script is currently happening, it will stop it immediately and move your camera back to your character.

If we typed this:

CameraModule:Start(workspace.MyPart, "Orbit", PresetParameters, 5)

wait(2)

CameraModule:Stop()

it will stop after 2 seconds, regardless of the number 5 that we gave to it.





Example of How to Use Module:


(requiring the module and running Wobble effect) (these parameters make the camera move like an earthquake)




(Keep in mind, this camera is extremely new, so definitely let me know if you notice any bugs)

I will be making updates pretty frequently. Planned updates are more presets and more PresetParameters.

If you have any questions or concerns, feel free to ask.

If you use this to make any really cool or interesting projects, let me know!

Enjoy the system!
( อกยฐ อœส– อกยฐ)

40 Likes

Canโ€™t wait to test this! As exploiters say, I vouch!

6 Likes

This is awesome iโ€™m gonna test it out later thanks!

1 Like

Woah! That looks awesome, great work!

1 Like

I think the name needs some work, EZCamera is pretty similar to EZ Camera Shake.
Otherwise, it looks cool.

Does the first parameter of :MoveCamera have to be an object, or can you also use CFrames and Vector3s interchangeably?

If the first parameter is a CFrame or Vector3, then it will set the cameraโ€™s cframe ONCE. Meaning if you do

MoveCamera(workspace.MyPart.CFrame, "Still")

it will move the camera to workspace.MyPartโ€™s CFrame, but when the part moves, the camera will not move with it. However, if i do want the camera to stay with the part when it moves, we put the object itself.

MoveCamera(workspace.MyPart, "Still")

This is great! I May use this in a little project of mine.

One thing Iโ€™d like to point out though:

This doesnโ€™t apply to the last element in a table.

1 Like

You should add like a Zoom parameter for the Still, so we could have camera looking at the back of the characterโ€™s head and such.

1 Like

I used a local script and this is what is inside of it, the module is in a folder in replicated storage btw.

local EZCam = require(game.ReplicatedStorage.Modules.EZCam)

EZCam:Start(game.Workspace.Part, "Still")

But this happens and the camera doesnโ€™t go to the part and I donโ€™t get any errors

What am I doing wrong?
https://i.gyazo.com/36e4bd8a6838bb5cc1fbdc16a94e61eb.mp4

1 Like

Thats a cool idea, but describe in more depth how you want that, that sounds interesting. I am currently in progress of creating more presets

also, if its not working, make sure you use :WaitForChild(objectName) instead of using the dot ( . )

It still isnโ€™t working. (30 c)

is it in a local script? if so, where is it placed?

Workspace. (30 charssssssssss)

thats why. Localscripts donโ€™t run in workspace, they need to be in certain places for them to run. Put it either in StarterGui, StarterPack, StarterPlayerScripts, or StarterCharacterScripts.

I put it in StarterPlayerScripts but it still does not work.

Here is the criteria for the module to work:

  • Must be a local script
  • Must not be disabled
  • Must be in either StarterGui, StarterPack, StarterPlayerScripts, or StarterCharacterScripts.

All three of those are met, yet it is not working still.

can you send me a picture of the local script in Studio? Also, send me a picture of all the code in it.
Its weird that its not working if there are no errors

Screenshot_106

Screenshot_107