Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Start () {
- Rigidbody2D player = GameObject.FindWithTag("Player").GetComponent<Rigidbody2D>();
- Vector3 mousePos = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.nearClipPlane));
- Vector3 playerPos = new Vector3(player.transform.position.x, player.transform.position.y);
- effect.transform.LookAt(mousePos - playerPos);
- //Quaternion.LookRotation(mousePos - playerPos);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement