“Unity Movetowards 2d” Kode Jawaban

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;
}
Legion

Unity Movetowards 2d


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

Jolly Jellyfish

Jawaban yang mirip dengan “Unity Movetowards 2d”

Pertanyaan yang mirip dengan “Unity Movetowards 2d”

Lebih banyak jawaban terkait untuk “Unity Movetowards 2d” di C#

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya