diff --git a/Player.gd b/Player.gd index 17a8bb7..249eb94 100644 --- a/Player.gd +++ b/Player.gd @@ -1,11 +1,11 @@ -extends KinematicBody2D +extends CharacterBody2D const MOVE_SPEED = 300 -onready var raycast = $RayCast2D +@onready var raycast = $RayCast2D func _ready(): - yield(get_tree(), "idle_frame") + await get_tree().physics_frame get_tree().call_group("zombies", "set_player", self) func _physics_process(delta): @@ -30,4 +30,4 @@ func _physics_process(delta): coll.kill() func kill(): - get_tree().reload_current_scene() \ No newline at end of file + get_tree().reload_current_scene()