MarchGame/scripts/npc_character.gd
2026-03-16 20:57:47 -04:00

13 lines
313 B
GDScript

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