Intérargir en marchant ne fait plus bugger
pas le temps d'expliquer, banzaï!
This commit is contained in:
@@ -5,6 +5,10 @@ extends Node
|
||||
var interactable : Node2D
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
human.stop_interaction()
|
||||
human.velocityVector = Vector2(0, 0)
|
||||
human.wants_to_grab = false
|
||||
human.wants_to_interact_with = null
|
||||
if (
|
||||
event.is_action("move_left") or
|
||||
event.is_action("move_right") or
|
||||
@@ -14,13 +18,9 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
if event.is_action_pressed("grab"):
|
||||
if interactable:
|
||||
human.stop_interaction()
|
||||
human.wants_to_interact_with = interactable
|
||||
else:
|
||||
human.wants_to_grab = true
|
||||
else:
|
||||
human.wants_to_grab = false
|
||||
human.wants_to_interact_with = null
|
||||
|
||||
func _process(delta) -> void:
|
||||
ray.target_position = human.last_facing_direction * 48
|
||||
|
||||
Reference in New Issue
Block a user