un peu de ménage

This commit is contained in:
Thomas
2025-03-29 19:59:22 +01:00
parent 01fb28cbdf
commit 2370915f90
2 changed files with 8 additions and 6 deletions

View File

@@ -2,11 +2,12 @@ extends Node2D
@export var human: Human
@export var ray : ShapeCast2D
var can_interact_with : Node2D
@onready var world: World = get_parent().get_parent();
@onready var pathFinder : HumanPathFinder = $"../PathFinder"
@export var pathFinder : HumanPathFinder
@onready var world: World = human.get_parent();
var possible_interactables : Array[Node2D]
# Stores the nearest Node2D we can interact with, then we can start interacting with it if the player
# press grab
var can_interact_with : Node2D
func _unhandled_input(event: InputEvent) -> void:
human.stop_interaction()
@@ -47,7 +48,7 @@ func _process(delta) -> void:
(ray.shape as RectangleShape2D).size = Vector2(20, 50)
# find all the possible interactables
possible_interactables = []
var possible_interactables = []
if ray.is_colliding():
var nbCollisions = ray.get_collision_count()
for n in range(nbCollisions):