Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity camera follow with lerp

public Transform target;

public float speed = 2.0f;

void Update () {
    float interpolation = speed * Time.deltaTime;

    Vector3 position = transform.position;
    position.y = Mathf.Lerp(transform.position.y, target.position.y, interpolation);
    position.x = Mathf.Lerp(transform.position.x, target.position.x, interpolation);

    transform.position = position;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# randize list 
Csharp :: c# get the first 4 characters in the list 
Csharp :: subtract days c# 
Csharp :: linq sum 
Csharp :: remove multiple items from list c# 
Csharp :: vb.net add row to datagridview programmatically 
Csharp :: c# combobox add item 
Csharp :: how to get row index of selected row in gridview asp.net webforms 
Csharp :: c# constructor call another constructor 
Csharp :: how to get current dir in c# 
Csharp :: unity toint 
Csharp :: how to get unique list in c# 
Csharp :: c# read all lines from filestream 
Csharp :: excel isrlgood 
Csharp :: mvc session key exists 
Csharp :: string tochar array c# 
Csharp :: if c# 
Csharp :: input field to float unity 
Csharp :: datatable iqueryable c# linq 
Csharp :: should i learn c # 
Csharp :: Print arraylist values to console unity 
Csharp :: on trigger unity 
Csharp :: get connection string from web.config in c# 
Csharp :: unity scroll rect to bottom 
Csharp :: get ad user using email address microsoft graph C# 
Csharp :: c# math method to reverse negative or positive 
Csharp :: where to write fluent api 
Csharp :: csharp csvhelper 
Csharp :: remove from list based on condition c# 
Csharp :: c# webapi return file 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =