Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity movetowards 2d

/// <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

unity movetowards 2d


transform.position = new Vector3(transform.position.x + movespeed, transform.position.y);

Comment

PREVIOUS NEXT
Code Example
Csharp :: c# get next item in list 
Csharp :: remap float c# 
Csharp :: string to date vb 
Csharp :: how to write blank lines in c#.net 
Csharp :: get filename from path c# 
Csharp :: require admin privileges c# 
Csharp :: keyboard input unity 
Csharp :: how to change rotate with script unity 
Csharp :: untiy delet ke 
Csharp :: how to set image Source in the code C# 
Csharp :: unity c# set list to set active true 
Csharp :: ef core dbfirst 
Csharp :: how to find how much digits in number c# 
Csharp :: how to make a dragable object in unity2D 
Csharp :: C# infinite clock coroutine loop 
Csharp :: unity get velocity of gameobject 
Csharp :: wpf image clip with rounded corners 
Csharp :: c# square every digit of a number 
Csharp :: xamarin overlay 
Csharp :: how to draw a rectangle in monogame 
Csharp :: revitapi 
Csharp :: car controller script unity 
Csharp :: game object find 
Csharp :: c# writteline 
Csharp :: how create another new app file in laravel 
Csharp :: += meaning c# 
Csharp :: How to read a XML on C# 
Csharp :: C# How to change the text colour? 
Csharp :: how to move mouse in c# 
Csharp :: get normal from 3 points 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =