Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. if (Input.GetMouseButton(0))
  2. {
  3. _direction = _camera.ScreenToWorldPoint(Input.mousePosition);
  4.  
  5. //_direction += Vector2.down * -4f;
  6. }
  7.  
  8. _velocity = Vector2.MoveTowards(transform.position, direction, speed * Time.deltaTime);
  9.  
  10. _rb2d.MovePosition(_velocity);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement