Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends KinematicBody
- const MAX_SPEED = 100
- var position = 0.0
- onready var KinematicBody = get_node("/root/level/KinematicBody")
- func _ready():
- pass # Replace with function body.
- func _physics_process(delta):
- if KinematicBody:
- var direction = (KinematicBody.position - position).normalized()
- move_and_slide(direction * MAX_SPEED)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement