How to trigger custom functions?
Posted: Fri Sep 18, 2020 9:43 am
Hi,
I am still struggeling with basics of Dialogue System.
How can I trigger my own C# functions in dialogue? For example when Player speaks to an NPC and the NPC says something offensive - I want the player to shoot the NPC. That means triggering my function that takes in 2 parameters:
void PistolShoot(float dmg, float bulletLifeTime)
The function is in a script attached to the player as a component.
What is the standart/best way of doing this? Do I have controll to trigger it at the end of the conversation node?
Lets say I would like a dialogue to close/open a gate in the future. How do you solwe theese kind of problems?
Thanks in advance
I am still struggeling with basics of Dialogue System.
How can I trigger my own C# functions in dialogue? For example when Player speaks to an NPC and the NPC says something offensive - I want the player to shoot the NPC. That means triggering my function that takes in 2 parameters:
void PistolShoot(float dmg, float bulletLifeTime)
The function is in a script attached to the player as a component.
What is the standart/best way of doing this? Do I have controll to trigger it at the end of the conversation node?
Lets say I would like a dialogue to close/open a gate in the future. How do you solwe theese kind of problems?
Thanks in advance