Skip to content

This is a template Assets file for Unity that contains a 3D scene with a moveable camera. This is mainly made for universe-like games/applications with a full range of motion and rotation.

License

Notifications You must be signed in to change notification settings

Ascyt/Unity-Camera-Movement-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Camera Movement Template

This is a template Assets file for Unity that contains a 3D scene with a moveable camera. This is mainly made for universe-like sandbox games/applications with a full range of motion and rotation.

What is this?

This repo contains an "Assets" file. You should be able to replace your Assets file with this one. Then double-click the Scene "Main" to open it. It's been made using version 21.3.20f1 with URP, so make sure to use this if you're encountering any issues.

The scene

The scene contains the following:

  • Main camera with a light object. This contains the CameraMovement script where you can edit the variables
  • RotatePoint, which is the object that the camera will rotate around when right-clicking
  • Global Volume, which is some URP stuff I guess
  • A sample cube object. You can delete this without problem, it's just there so that the scene isn't completely empty

The Main Camera contains the CameraMovement class. There you can set, for example, the sensitivies or how far away the target will be from the camera.

Features

If you hold Alt while doing any of the following movements, they will be more precise.

Movement

You can move the camera using WASD and QA, or the arrow keys and shift and control. You can also use the mouse wheel to move the camera forwards and backwards, or left and right if you're able to scroll vertically.

Rotation

If you press left, right or middle click the cursor will be locked. If you let go, the cursor will return to the original position in Windows and into the middle of the window in other operating systems.

There are three different types of rotations:

  1. Rotation (left click): This rotates the camera like in a first-person-shooter.
  2. Rotation around target (right click). This will rotate the camera around the target object that's shown when you do said movement. Scroll while doing this to move the target in/out, left click to revert it to default.
  3. Panning (middle click): Pans the camera like it's a 2D scene.

image

About

This is a template Assets file for Unity that contains a 3D scene with a moveable camera. This is mainly made for universe-like games/applications with a full range of motion and rotation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages