Fatih Tkale Fatih Tkale - 1 month ago 5
C# Question

My text get flipped automaticly

So this is my code

public Transform target;
void Update()
{
if (target != null)
{
transform.LookAt(target);
}
}


this is suppose to look at the player under any state but some how it get my Text mesh gets fliped
how it looks in unity:

https://gyazo.com/6ae1b42508bbd6b8bcb168ca2cdeca28

Answer

Use this instead of lookAt

transform.rotation = Quaternion.LookRotation(transform.position - target.position);
Comments