Unity Camera Size To Velocity 2D by tonisuo - 1

CameraGames & Projects

Simple script to change the cameras size depending on the velocity of the target

Unknown VersionMIT LicenseUpdated 3 years agoCreated on August 10th, 2017
Go to source





Use this simple script to tie your camera size to the target RigidBodys velocity. In a 2D side-scrolling game this can be used to show you more of the game area when the player is moving faster.


Assign a RigidBody2D component to the target variable, the script uses this objects velocity to determine the size of the camera.

Assign a minimun and maximum values to the mincam and maxcam variables to control the overall size of the camera.

Show all projects by tonisuo