Page 1 of 1

How to trigger custom functions?

Posted: Fri Sep 18, 2020 9:43 am
by Trebkiller
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 :)

Re: How to trigger custom functions?

Posted: Fri Sep 18, 2020 12:53 pm
by Tony Li
Hi,

Here's the tutorial:



If you have any questions about it, just let me know.