How can i interupt a Path2D, for example to talk with a patroling NPC ?
I have more questions for my "game" (topdown view, adventure game)
------ NPC (as a KinematicBody2D, instanced) + Script
The NPC also has an Area2D to print text on screen when collision with player.
The script for NPC :
extends KinematicBody2D func _ready(): set_fixed_process(true) func _fixed_process(delta): get_parent().set_offset(get_parent().get_offset() + (20*delta))
The script for Aera2D :
extends Area2D func _on_Area2D_body_enter( body ): var textEvent = get_node("/root/Univers/GUI/BoxEvent/EventLog") textEvent.set_scroll_follow(true) textEvent.add_text("Hello ! ") print ("Encounter !")
So the NPC simply follow its path, forever, and when te player moves to the NPC, the text says Hello... All is working so far.
I'd like to make the NPC to stop moving when meeting the player, and move again when the player moves away. I managed to destroy the NPC on collision, but that was a mistake, i swear...
Where to start ?
Thanks for reading.