tonisuo / CameraSizeToVelocity2D

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity-CameraSizeToVelocity2D

Example

example

Description

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.

Usage

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.

About

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

License:MIT License


Languages

Language:C# 100.0%