Page 1 of 1
Quests not showing
Posted: Sat Oct 02, 2021 10:19 am
by TheTeaStoners
dear,
following up on my question on your youtube video
i have here the screenshots for the Quest Giver component
<<<
- Schermafbeelding 2021-10-02 om 16.04.07.png (152.06 KiB) Viewed 485 times
- Schermafbeelding 2021-10-02 om 16.04.26.png (112.93 KiB) Viewed 485 times
here is the screenshot for the player component
- Schermafbeelding 2021-10-02 om 16.04.55.png (124.18 KiB) Viewed 485 times
and here is the configuration for the Journal Button
- Schermafbeelding 2021-10-02 om 16.01.10.png (19.22 KiB) Viewed 485 times
here is my game view how i organized it
- Schermafbeelding 2021-10-02 om 16.18.21.png (105.75 KiB) Viewed 485 times
thanks in advance
Re: Quests not showing
Posted: Sat Oct 02, 2021 12:18 pm
by Tony Li
Hi,
Thank you for posting the screenshots.
Do you want the Quest Giver NPC's quest dialogue to appear when the player clicks on the Quest Giver NPC?
If so, then you will want to configure the Quest Giver NPC to invoke QuestGiver.StartDialogueWithPlayer() when the players clicks on it.
One way to do this is to add a world space canvas to the NPC. Add a UI Button to the canvas. Configure the Button's OnClick() event to invoke QuestGiver.StartDialogueWithPlayer().
Another way is to add a script that has an OnMouseDown() method. (Note: This method works with Unity's built-in input manager, but it does not work with the new Input System package in case you've switched to the new Input System.)
Here's an example script:
MouseDownEvent.cs
Code: Select all
using UnityEngine;
using UnityEngine.Events;
public class MouseDownEvent : MonoBehaviour
{
public UnityEvent onMouseDown;
private void OnMouseDown()
{
onMouseDown.Invoke();
}
}
If you add this script and a collider to the Quest Giver NPC, the script will have an OnMouseDown() UnityEvent. You can configure the UnityEvent to call QuestGiver.StartDialogueWithPlayer().