15 min
“Superliminal” features absolutely mind-bending ways of interacting with your enviroment, one allowing you to resize and reposition parts using only your mouse and your camera, as seen in the first scene of this video: I wanted to recreate this effect in Roblox, so follow along through my (suprisingly quick) adventure of scripting. Our final product can be used like this: First attempt How.
Beyond basic articles/customizing the camera|camera customization
, you can manipulate the game camera to create specific player/character view systems, lock the camera to a world position, create unique camera effects, and more.
Camera Properties
The Roblox Camera
has several built-in properties, including:
Property | Description |
---|---|
Camera/CFrame | The BasePart/CFrame|CFrame of the camera. This property is frequently used to position and move the camera in game. |
Camera/Focus | The point in 3D space where the camera is looking. When pointing the camera in a specific direction, you should update this property because certain visuals will be more detailed depending on how close they are to the focus point. |
Camera/FieldOfView | The extent of the observable game world that can be seen on screen, measured between 1–120 degrees in the vertical direction (default is 70). |
Scripting the Camera
Inside scripts, the game camera can be accessed with the Workspace/CurrentCamera|CurrentCamera
object:
LocalScript
within StarterPlayerScripts
or StarterPack
. Placing any of the following scripts elsewhere will not allow the code to properly take control of the camera.Over-the-Shoulder
A basic over-the-shoulder camera, commonly found in third-person shooter games, can be achieved with the following script. This camera stays locked behind the character’s back and players use the mouse to turn (not directional input).
-2, 2, 8
) or pull the camera further away from the player (2, 2, 15
).Scope In/Out
A simple scope in/out camera system can be implemented using the following script. This example uses the middle mouse button to zoom in and out, and the ability of ContextActionService
to create a virtual zoom button on mobile devices.
TweenInfo.new()
on line 9 and the scope zoom power can be adjusted with the FieldOfView
value on line 60 (values between 10 and 20 work best).Rotate Around Object
To rotate the camera fully or partially around a part, experiment with the following script which features adjustable camera offset, rotation time, repetition count, easing styles, and more.
cameraOffset
vector values of 0, 30, 12
, setting lookAtTarget
to true
will make the camera tilt downward to look directly at the object.Side-Scroller
A typical side-scrolling camera system can be implemented using the following script. This example locks the camera to the X plane at an adjustable Z offset from the player.
articles/customizing game controls|Customizing Game Controls
for instructions.cameraChase
values on line 6 control how many studs the player can move away from the 'screen center' before the camera begins chasing them. Each directional value can be adjusted to fit your game design and whatever feels best based on the cameraDistance
value (line 7).Roblox Camera Manipulator Download Pc
- -- Made by fishguy100
- function TweenCamera(c1,f1,step)
- c.CameraSubject =nil
- for i =1,181,step do
- local r =(1/181*i)
- c.CoordinateFrame = CFrame.new(c0.p:lerp(c1.p,r))
- c.CoordinateFrame = CFrame.new(c.CoordinateFrame.p,c.Focus.p)-- This is used for the CoordinateFrame to Look at the Focus.
- end