Skip to content
Lee Seokhyun edited this page Sep 13, 2020 · 7 revisions

This document has some detailed information about the EasyFingerCamera.

EasyFingerCamera is the camera control system in mobile games. (Also, available on PC platforms)

Introduction

This is the camera control system scripts. There are two features in this asset.

Zoom system

  • Using a mouse wheel on a PC platform.
  • Using two fingers pinch system on a mobile platform.

Movement system

  • Using a mouse button on a PC platform.
  • Using a finger drag system on a mobile platform.

Each feature contains smooth interpolations. Of course, it supports tough methods. You can select which one use.

In the demo scene, there is a runtime inspector UI on the game view. You can control the variables on a mobile device at runtime without additional build.

Project structure

scene_path

Open the demo scene file in the above path.

scene_hierarchy

You can see EFCPivot game object in the hierarchy.

The EFCPivot game object is the main object of this system. It contains main feature scripts. The MainCamera object is the child of this object.

camera_structure

When you try to drag your mouse button(or touch on a mobile platform), the transform of EFCPivot would move instead of the MainCamera object directly. This is very useful in third-person camera systems.

efc_main_scripts

There are three main scripts on this system.

Let's hop into each feature.

Translate

efc_translate_hierarchy

Click the EFCPivot game object. You can see the two scripts. The first one is EFCTranslate component. This implements the movement of the camera. In the inspector, there are some variables you can edit.

Invert direction : Reverse the direction of movement. For example, When you drag your mouse to left, the camera would move in the same direction.

Sensitivity : This variable is the touch sensitivity to start features. If this variable is bigger, you should move your finger very long before move the camera. If this variable is smaller, the camera would move directly after you had touched. This is useful for mobile devices.

Move speed : The speed of movement.

IsApplyZoomRate : Depending on current zoom status. With maximum zoom, the movement becomes rapid and can be adjusted smoothly.

IsSmooth : Smooth movement of tough movement.

Acceleration : Acceleration of the movement. If this variable is smaller, the camera slides. If this variable is bigger, it moves instantly.

IsIgnoreOnUI : Ignore touch detection on a UI element.

Touch correction : Used on a touch correction on a mobile platform.

Selected button : Used on a PC platform the select which button to use.

Zoom

efc_zoom_hierarchy

Target Camera : The target camera to zoom.

Hidden Zoom Target : A hidden transform object for the zoom system. If you select the zoom type is Position, this would be used to move the TargetCamera object.

IsSmooth : Smooth zoom.

Zoom Speed : The speed of the zoom in perspective mode.

Orth Zoom Speed : The speed of the zoom in orthographic mode.

Zoom Type : You can choose between Fov and Position.

Min Fov : Minimum field of view on perspective mode.

Max Fov : Maximum field of view on perspective mode.

Min Distance : Minimum distance of view on perspective mode.

Max Distance : Maximum field of view on perspective mode.

Min Ortho Size : Minimum camera size of view on orthographic mode.

Max Ortho Size : Maximum camera size of view on orthographic mode.