Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Input.GetMouseButton(0))
- {
- _direction = _camera.ScreenToWorldPoint(Input.mousePosition);
- //_direction += Vector2.down * -4f;
- }
- _velocity = Vector2.MoveTowards(transform.position, direction, speed * Time.deltaTime);
- _rb2d.MovePosition(_velocity);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement