Skip to content

Finger Camera provides a small preview window on mobile devices, displaying the object beneath the finger to prevent obstruction. Easily customizable, with included examples.

License

Notifications You must be signed in to change notification settings

SitronX/UnityFingerCamera

Repository files navigation

UnityFingerCamera

Touch input on mobile devices has one major issue: users typically don't see what they are really doing on the screen because they cannot see below their finger. This is especially problematic when performing drag-and-drop operations on world objects. This asset will help you mitigate that issue.

Finger camera is easy-to-use, modular utility that you can attach to any world object and the camera will follow the object from a specified angle.

This way, users can actually see their actions on the object immediately.

Here is a showcase of the finger camera in provided example scene.

Chess.mp4

Note: Although this asset is primarily designed to mitigate the issue of finger blocking, it can also be used in other scenarios, such as showing what is currently happening on a specific object that the player can't see (e.g., an object placed in another room).

How to install

You have two options for installing it into your project:

  • First option: Download the prepared Unity package from the GitHub release section. After downloading, open your Unity project and simply open the downloaded package. An import dialogue window should appear (Unity should automatically associate the package with itself). If it doesn't work for you, you can also import it through the Unity Package Manager.

  • Second option: Download this sample project from GitHub and start using it, or just import the FingerCamera folder under Assets/ into your project.

Note: Unity versions 2019+ are officially supported

Finger Camera features

  • Define the starting position of the finger window
  • Resize/reposition the window during play
  • Customize camera rotations relative to the tracked object
  • Zoom in/out of the tracked object
  • Option to save window parameters, allowing users to modify them and retain the settings when the game restarts

How to use

Detailed steps on how to use FingerCamera are explained in the documentation.

If you still face any problems, feel free to contact me. I can help you out.

Example scenes

An example scenes demonstrating basic interaction on a chessboard are available. The scenes are located under Assets/FingerCamera/ExampleScene

The example scenes are primarily designed for touch controls but can also be controlled with mouse input.

Note: The examples scenes are created in the Built-in Render Pipeline. If you want to open it in URP, simply upgrade the scene materials to URP, and everything will work fine.

First example scene

The first example scene showcases the usage with 3D elements on chess board.

The controls are:

  • Left mouse click: grab the chess piece
  • Right mouse click: move/resize/zoom the finger camera window

Second example scene

The second example scene showcases the drag behaviour with UI stuff. Also some additional features are shown here, like closest edge detection and window finger tracking.

FingerCameraUI-ezgif com-optimize

The controls are:

  • Left mouse click: Grab and do drag & drop to the other side

Real game showcase

Here is a showcase of this asset in real game.

Forcel.mp4

The game was the main propellant for releasing this asset. You can download it for free on Google Play.

Thanks to community support, this is the second feature "gutted" from the game and made open for the community. If you're curious, you can find the first (Time-Rewinding) repository here.

License

This asset is completely free under the MIT license, so you can use it as you wish :)

If you like my projects, please consider buying me a coffee to support my work. All donations will be greatly appreaciated :)

BuyMeACoffe

About

Finger Camera provides a small preview window on mobile devices, displaying the object beneath the finger to prevent obstruction. Easily customizable, with included examples.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages