Quantcast
Channel: Answers by "stockhouse50"
Viewing all articles
Browse latest Browse all 4

Answer by stockhouse50

$
0
0
Alright finally after all my searching I found the answer. The solution I found doesn't use lookat() but does the job. Vector3 diff = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position; diff.Normalize(); float rot_z = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(0f, 0f, rot_z - 90);

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images