Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

Converting world rotation to screen rotation

$
0
0
I am trying to turn ui element toward the 3d-world object.
can anyone tell me what is wrong in my code?
Code (CSharp):
  1.                 Vector3 posA =
  2. GameObject.FindGameObjectWithTag("PlayerShip").transform.position;//Player Position
  3.                 Vector3 posB = target.transform.position;//Target Position
  4.                 Quaternion dir = Quaternion.LookRotation (posA - posB);//Get Direction
  5.                 dir = Quaternion.Euler(0f,0f,dir.eulerAngles.y);...
Converting world rotation to screen rotation

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>