Controlling the Player Camera

# Course Introduction

The main camera of the game always follows the player. The camera component that controls the main camera is owned by the MapleStoryPlayer model. By using the Property Editor or script for this model, you can edit the main values. In this course, we will learn about the full functions of the Camera component by editing it in the Property Editor.

# Approaching Camera Component

In Workspace, select DefaultPlayer model. [png](1635470229255887ebcf3484b4ceb8a43d4b77d8af063)   
In the Property Editor, check CameraComponent. CameraComponent offers several properties for the camera control. [png](1653012043486ba0619b7c3984494b5a7091c43500689)   
We will examine each of the features of the camera component in detail.

# DeadZone

If you watch the video below, the camera doesn't follow the movement of the player avatar when it moves slightly left or right. [gif](1657019820558b44468bafaf543d09447717a4987613f)   
When it jumps, the player avatar moves up and down on the Y axis, but the camera doesn't move. Likewise, while the player avatar stays in the DeadZone, the camera doesn't follow the avatar's movement. [png](165702062238605bd4be1a9174ee48bc5ce6512c80f0f)   
If the DeadZone value is changed to 0, the camera reacts to small movements as shown below. [gif](1657019829316abef7f6dc9b94ec79cc6865a63e25d67)   
Depending on the game you are creating, when you don't have a DeadZone, players may tire of sensitive camera movement. However, in a game that requires quick movement, if you set a big DeadZone, the responsiveness may suffer. If you adjust this value in accordance with the style of game you are creating, it can greatly enhance the feel of the action.

# SoftZone

Outside of the DeadZone is SoftZone. [png](1657017680023250571fd27f94d1cbda001a2b372ae8c)   
If a player avatar is located in the SoftZone, the camera will chase after the player avatar to ensure that it doesn't move off the screen. When moving outside of the SoftZone, the camera chases after the player avatar even faster.

# Damping

Damping is a ratio that connects the before and after movements smoothly by stopping the fast movement of the camera when a player avatar escapes from the DeadZone. If this value increases, the speed of the camera chasing the player avatar becomes smoother. As an extreme example, if you greatly increase the values of the Damping and SoftZone, the speed of chasing the player avatar becomes very slow, allowing for situations where the avatar might escape from the camera. [gif](16570191045568fcfc3ae70714c339d1c00f8769f5b1a)

# CameraOffSet

Edit the location where the camera views the player. You can better understand if you see the difference between the default value and the edited value below. (Change x value) [png](16570177781742ef034f8531742fb95c3726007ac09c2)[png](165701780364165f094a24a814c2ba6410832691f10d2)

# DutchAngle

Sets the rotation value of the camera. If you enter 80 for the angle, it will look like the image shown below. [png](16570178319148e3e4420a1164958a85a65787011d4a2)

# Screen Offset

Although you can edit the point of showing the player avatar similar to CameraOffset, this value is the proportion value of the screen based on the subject. You can enter a value between 0 and 1, where a value of 0.5 places the camera at the center. For example, an X value of 0.8 will place the Player Avatar on the right side of the screen as shown below. [png](16570178556921cd2a75c27ca4ad1ab666cbadf106ba2)

# isAllowZoomInOut

In the Maker screen, you can zoom in or out on the screen by moving the mouse wheel up or down. If this value is set to True, the player can also zoom in and out using the mouse wheel while playing. [gif](165701854542594cce980f29f4bc9b9c14dc75c766830)

# UseCustomBound

You can choose to define and use the camera-restricted area. If the UseCustomBound value is True, you can use the LeftBottom, RightTop property to define camera-restricted area. Press the Collider Edit button to either visually check the camera-restricted area through the gizmo displayed in the Scene  or easily adjust the area using a handler. [gif](16570204046562c59667490614c61917b3a312c8579a5) If the CameraComponent - UseCustomBound value is False, the map area is used as the camera-restricted area. If the MapComponent - UseCustomBound value of the map area is False, the map area is set to its default state. When the map area is in the default state, the camera-restricted area is defined as the corrected area based on that default area. However, if the MapComponent - UseCustomBound value is True, the map area set by the creator is used as the camera-restricted area. Here is a summary.

[{"Component configuration":"CameraComponent - UseCustomBound - True","Camera-restricted area":"Use the camera-restricted area defined by the creator"},{"Component configuration":"CameraComponent - UseCustomBound - False MapComponent - UseCustomBound - True","Camera-restricted area":"Use the map area defined by the creator as the camera-restricted area"},{"Component configuration":"CameraComponent - UseCustomBound - FalseMapComponent - UseCustomBound - False","Camera-restricted area":"Use the area corrected based on the default map area as the camera-restricted area"}]