Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

move towards target unity

/// <summary>
/// Move 2D sprite towards target
/// </summary>
/// <param name="target"></param>
/// <param name="movementSpeed"></param>
private void Move(Vector3 target, float movementSpeed)
{
    //Move
    transform.position += (target - transform.position).normalized * movementSpeed * Time.deltaTime;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: headless chromedriver C# 
Csharp :: list add at index c# 
Csharp :: how to do a web request unity 
Csharp :: c# json to dictionary 
Csharp :: difference between namespace and assembly in c# 
Csharp :: require admin pervillages c# 
Csharp :: c# repeat string x times 
Csharp :: c# write to console 
Csharp :: c# application hangs while running 
Csharp :: unity ui change sprite 
Csharp :: c# separate string by a new line 
Csharp :: ef database first generate models entity framework core 
Csharp :: check if ienumerable is empty c# 
Csharp :: unity gameobject.find not working 
Csharp :: unity google play games plugin spam 
Csharp :: xamarin picker item 
Csharp :: tooltip button winform 
Csharp :: Request.ServerVariables["HTTP_X_FORWARDED_FOR"] get only one ipaddress 
Csharp :: c# null check can be simplified 
Csharp :: C# executing assembly path 
Csharp :: blank background for button wpf 
Csharp :: unity detect object with raycast 
Csharp :: detect trigger in unity 
Csharp :: ++ operator c# 
Csharp :: transfer ownership photon2 
Csharp :: lump in neck under jaw 
Csharp :: c# and 
Csharp :: c# get pixel color from image 
Csharp :: unity detect any key 
Csharp :: unity json save array 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =