Godot Version
Godot 4
Question
Hello, I am trying to make a dialogue system with Nathan Hoad’s dialogue plugin. I made my npc a characterbody with a colisionshape, sprite and an area 2d . My problem is that I have set the mask of the npc’s character body at 5 layer at 1 , the area2d mask on 5 andsame for the player
And the characters just phase true and cant interact or the text laber I put above the npc doesnt show up when you enter his body and I dont understand what I did wrong
func _on_chat_detection_area_body_entered(body: Node2D) -> void:
text.visible = true
text.visible = true
This is the code for the npc
extends CharacterBody2D
@export var dialogue_resource:DialogueResource
@export var dialogue_start: String = "start"
@onready var text = $Label
var jucator
var is_chatting = false
var player_in_chat_zone = false
func _on_chat_detection_area_body_entered(body: Node2D) -> void:
text.visible = true
if body.has_method("jucator"):
jucator = body
jucator._player_in_chat_zone = true
func _on_chat_detection_area_body_exited(body: Node2D) -> void:
text.visible = false
if body.has_method("jucator"):
player_in_chat_zone = false
func _process(delta: float) -> void:
if Input.is_action_just_pressed("talk") and player_in_chat_zone == true :
DialogueManager.show_example_dialogue_balloon(dialogue_resource, dialogue_start)