Set Camera

Revision as of 16:33, 21 May 2024 by -u ndefined- (talk | contribs) (2D_game -> 2D_scene)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Sets the position, rotation (angle) and range of the camera. Works in two modes: orthographic (isometric) and perspective.

Set Camera
Set_Camera.png
TypeScript block
ColliderNone
FolderGame
Ports
Inputs Before
Position
Rotation
Range
Outputs After

Notes

The camera's default position and rotation are the center of the world and true isometric (approximately35.264, 45, 0) angle respectively.

Settings

The camera uses the orthographic mode by default. The perspective switch can be found at the bottom-right of the hotbar.

 

Modes

Orthographic mode

To calculate the Range input, multiply the amount of blocks needed to fit on the screen by 5.

 

Perspective mode

Range is the angle of the bisector of the Field of View of the camera. The FoV of a human is considered 120°, so if you want to make first-person games, use 60° as Range. The minimum and maximum is 1-65 (inclusive).

 

Comparison

 

Tips

If you want to adapt your 2D game to the perspective view, this is the way to do it. (The Size variable defines the amount of blocks you want to fit)