Demo Spawner Missing
Re: Demo Spawner Missing
In your step two (assigning player to interact object), how could I do this via C#?
Re: Demo Spawner Missing
What option do I select from the pop up menu once I have clicked the plus?Also select the blank element in the Dialogue For Rewards Section, then click the "+". This is a mistake in the prefab that's fixed in version 1.0.2.
Re: Demo Spawner Missing
Oops, sorry, I meant "-". The intent is to remove the erroneous blank element.
Re: Demo Spawner Missing
I'll explain how to set up the Targetable component's OnInteract() event below. But, since you're using C#, you may find it easier to simply call the C# method. If your C# script is on the quest giver, do something like this:
Code: Select all
var player = GameObject.FindWithTag("Player");
GetComponent<QuestGiver>().StartDialogue(player);
However, if you want to set up the Targetable component, try this:
Code: Select all
var targetable = GetComponent<Targetable>();
var questGiver = GetComponent<QuestGiver>();
var player = GameObject.FindWithTag("Player");
targetable.onInteract.AddListener(delegate { questGiver.StartDialogue(player); });
Re: Demo Spawner Missing
Thank you very much. You have been very thorough and quick to respond. That makes for GREAT customer service!
That was just what I was looking for.
That was just what I was looking for.
Re: Demo Spawner Missing
My pleasure.
Full disclosure: I typed the second code block directly into the reply. I didn't test it. There might be typos. If it doesn't work right off the bat, you may need to fiddle with it. I'll give it a test now and fix my reply if necessary.
Edit: Okay, tested and corrected. Apologies for my laziness earlier.
One thing I should add: In version 1.0.1, the Player prefab isn't tagged "Player", so the code above won't find the player unless you set the tag.
Full disclosure: I typed the second code block directly into the reply. I didn't test it. There might be typos. If it doesn't work right off the bat, you may need to fiddle with it. I'll give it a test now and fix my reply if necessary.
Edit: Okay, tested and corrected. Apologies for my laziness earlier.
One thing I should add: In version 1.0.1, the Player prefab isn't tagged "Player", so the code above won't find the player unless you set the tag.