Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export (int) var speed = 200
- var velocity = Vector2()
- func _physics_process(delta):
- velocity = (get_global_mouse_position() - position).normalized() * speed
- # rotation = velocity.angle()
- if (get_global_mouse_position() - position).length() > 5:
- move_and_slide(velocity)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement