MarchGame/scripts/npc_character.gd

13 lines
313 B
GDScript3
Raw Normal View History

2026-03-17 00:57:47 +00:00
class_name NPCCharacter extends CharacterBody2D
func _physics_process(delta: float) -> void:
if not is_on_floor():
velocity+=get_gravity() * delta
move_and_slide()
func knockBack(direction,duration:float=0.2):
velocity =direction
await get_tree().create_timer(duration).timeout
velocity =Vector2.ZERO