Camera

The player observes the game through the camera. Using different modes of camera and camera parameters can provide different visual representations of the game.

Camera Module

The camera module is a default module and does not need to be loaded.

image-20240911182555100

You can configure the main camera in the camera module.

Camera Module

In the camera module, after selecting a camera mode, you can set further parameters for this mode.

Among the parameters, there are some parameters that are common to some camera modes:

image-20240911182613203

Common Configuration

Lens Rotation Angle Limit Type: by selecting Keep Original Logic, the camera limits the angle at which the player can manipulate the rotation. Select WideRange and this restriction will be relaxed.

Field of view: the angle that the camera can see.

image-20240910155604898

Occlusion Mode: how occlusion between the camera and the player character is handled when it occurs, except for the first-person camera. There are three modes: fixed, push close and perspective.

image-20240910164055112

At this point the camera continues to rotate and is blocked by walls.

Fixed mode is not handled even if there is an occlusion between the camera and the player character.

image-20240910164104396

Nudge mode, the camera changes its position and moves closer to the player character as if squeezed by an occluder.

image-20240910164258233

In perspective mode, the player character is marked with a red stroke.

image-20240910164454220

Projection Mode: In perspective mode, the camera processes things using the near-large-far-small rule as in reality. In orthogonal mode, the camera processes things without using the near-large-far-small rule.

image-20240910173104387

Perspective Mode

image-20240910173353307

Orthogonal Mode, in general, orthogonal mode is suitable for situations with special requirements for Scene, such as horizontal board crossing games.

Offset: In cameras that support setting offset, the offset of (0, 0, 0) is the initial default position of the camera, by setting this parameter, you can adjust the default position of the camera.

Third person camera

The third-person camera is a certain distance away from the player and will render the player character. In the default third-person camera mode, the player is free to rotate the camera, and the player’s forward movement command will cause the player character to move forward in the direction the camera is looking.

image-20240910170247388

image-20240910170300191

The player will turn in the direction of movement before moving forward.

FF Classic

FF Classic is a third-person camera like the FreeFire games. FF Classic mode cannot be changed.

Back Chase

The Back Chase camera will always look at the player’s back. In this mode, the horizontal orientation of the player character is always equal to the horizontal orientation of the camera, and turning the camera rotates the player character at the same time.

First Person Camera

The first-person camera overlaps the player character’s position, as if looking at the game world from the player character’s point of view. The default first-person camera does not support adjusting the field of view.

New first person resources

A new version of the first person resources is available at the bottom of the module.

image-20240911182655142

When the new version of the first person resource is checked, the camera will always show both hands, instead of only showing hands when performing Animation.

FF Classic

FF Classic’s first-person camera is consistent with FreeFire’s in-game first-person view; FF Classic’s first-person camera has a dynamic effect that changes the scope of the field of view as you move.

Top View Camera

The top-down camera is always oriented horizontally by default, and will follow the player as they move.

image-20240910175642062

Landscape view camera

The landscape view camera will always be oriented towards the positive Z-axis in the world coordinate system by default, and will move with the player as they move.

image-20240910180227779

The landscape view camera has a unique configuration:

image-20240911182724156

Pitch and Horizontal Angle: allows you to adjust the initial angle of the camera, which the camera will keep after configuration.

Whether to allow player X-axis movement: when turned on, player movement commands to the inside and outside of the screen will be blocked, and the player will only be able to move to the left and right sides of the screen.

Free View Camera

In Free View Camera mode, the player’s movement commands operate the camera instead of the player character. By default, the free-view camera vertical view controls are flipped.

image-20240910180722654

Custom Camera

Custom cameras will only follow the player and have no other function, it is up to your configuration to determine how the player behaves when using the camera.

image-20240910181200118

Scripts

In addition to configuring the main camera, use scripts to dynamically adjust camera parameters, create or switch cameras.

image-20240910190054154

Create & switch cameras

image-20240910190216300

By creating a camera it is possible to create an additional camera, but that camera is not put into use and the player’s camera does not change.

Camera performance can be adjusted after creating a camera by setting the properties of that camera.

With switch camera, you can switch to the specified camera before the player starts using the new camera.

Masking

Cameras can selectively render objects or players on the map by modifying the mask level. In all visible units with a visibility component.

image-20240910190543378

Set the layer level in this component, and then in the camera’s mask modify the layer at which that camera will render.

image-20240910190647512

By default, the camera renders all layers (0-15), pictured here without rendering objects with layer 1.

By modifying the mask level, you can achieve the purpose of hiding the visibility of the specified class of units, saving performance, and so on.

However, even though the units are not visible, other features such as collision are still present, and the player will still be blocked or trigger certain collision events by objects in the non-rendered layers.