un peu de ménage
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user