Horje
unity sprite disappears when using transform.lookat Code Example
unity sprite disappears when using transform.lookat
// Do not use "transform.LookAt" for 2D 
// Instand use something similar to this

public static void LookAt2D(this Transform transform, Vector2 target)
{
    var direction = target - (Vector2)transform.position; // Get the direction
    var angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg; // Convert to angle
    transform.rotation = Quaternion.AngleAxis(angle - 90, Vector3.forward); // Finally rotate the GameObject
}




Csharp

Related
oracle c# parameters wont work Code Example oracle c# parameters wont work Code Example
update a file where there is a keyword c# Code Example update a file where there is a keyword c# Code Example
c# best way to loop and remove Code Example c# best way to loop and remove Code Example
windows forms webbrowser refresh Code Example windows forms webbrowser refresh Code Example
how to chceck for a tag in a trigger enter 2d unity Code Example how to chceck for a tag in a trigger enter 2d unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9