Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. void Start () {
  2.  
  3. Rigidbody2D player = GameObject.FindWithTag("Player").GetComponent<Rigidbody2D>();
  4.  
  5. Vector3 mousePos = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.nearClipPlane));
  6. Vector3 playerPos = new Vector3(player.transform.position.x, player.transform.position.y);
  7.  
  8. effect.transform.LookAt(mousePos - playerPos);
  9. //Quaternion.LookRotation(mousePos - playerPos);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement