Cameras
Configure game cameras for different gameplay styles.
Introduction
The camera determines what the player sees. This tutorial covers camera modes, positioning, and how to choose the right camera for your game type.
Tutorial 17 of 18
Screenshot
Step-by-Step Guide
Find the Main Camera
Look in the hierarchy for "MainCamera". Every scene has one by default. Select it to see its properties.
Choose a camera mode
In the Inspector, set the Camera Mode: First Person, Third Person, Top Down, or Fixed.
Position the camera
For Third Person, place the camera behind and above the player. For Top Down, place it high above looking down.
Set field of view
Adjust the FOV (Field of View). 60° is standard, 90° is wide-angle (FPS), 30° is telephoto (cinematic).
Configure follow
For Third Person, set the camera to follow the player object. Adjust follow speed and look-at target.
Test in Play mode
Press Play and move your player. The camera should follow smoothly without jitter. Adjust damping as needed.
FluxScript Example
Here is the FluxScript (Appley Scripting) code for this tutorial:
// Camera configuration and control
on start {
cam = scene.find("MainCamera")
// Third person follow setup
cam.setMode("third_person")
cam.setFOV(60)
cam.setFollowTarget(player)
cam.setFollowOffset(0, 5, -8) // Behind and above
cam.setLookAtTarget(player)
cam.setDamping(5) // Smooth follow
}
on update(dt) {
cam = scene.find("MainCamera")
// Camera zoom with scroll wheel
scroll = input.getScroll()
if scroll != 0 {
offset = cam.getFollowOffset()
newZ = math.clamp(offset.z + scroll * 0.5, -15, -3)
cam.setFollowOffset(offset.x, offset.y, newZ)
}
// Camera rotation with right mouse button
if input.getMouseButton(1) {
mouseX = input.getMouseDelta().x
cam.rotateAroundTarget(0, mouseX * 0.3, 0)
}
}Node Script Equivalent
Prefer visual programming? Here is the same logic as a Node Script graph:
[On Start] ──► [Find: "MainCamera"]
──► [Set Mode: third_person]
──► [Set FOV: 60]
──► [Set Follow Target: player]
──► [Set Follow Offset: (0, 5, -8)]
──► [Set Damping: 5]
[On Update] ──► [Get Scroll] ──► [Branch: != 0]
├─ True ──► [Clamp Z] ──► [Set Offset]
──► [Get Mouse Button: 1] ──► [Get Mouse Delta]
──► [Rotate Around Target]Pro Tip
Watch Out
