Thank you for your awesome asset !
I have a problem with the dialogue system and the new input. I can trigger it and It works as intended but if I'm in collision with the gameobject and I close the dialog, the dialog will launch again and I don't know who I can resolve that.
The dialogue trigger is set to OnUse and I launch it when I'm in collision with the gameobject.
I set a variable that will let launch the dialogue if I'm in collision with the gameobject.
Code: Select all
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "vThirdPersonCamera")
{
canLaunchDialogue = true;
}
}
Code: Select all
private void OnCollisionExit(Collision collision)
{
if (collision.gameObject.name == "vThirdPersonCamera")
{
canLaunchDialogue = false;
}
}
Code: Select all
void Update()
{
if (joueurGameObject.GetComponent<PlayerInput>().actions["Action1"].ReadValue<float>() == 1 && canLaunchDialogue == true && dialogueManager.GetComponent<PixelCrushers.DialogueSystem.DialogueSystemController>().IsConversationActive == false)
// If the user press Enter with the keyboard or A with a joystick, and the gameobject is in collision, and a dialogue is not launched, the dialog will launch
{
this.gameObject.GetComponent<PixelCrushers.DialogueSystem.DialogueSystemTrigger>().OnUse();
}
}