if(Input.GetKeyDown(KeyCode.J))
{
QuestMachine.GetQuestJournal().ToggleJournalUI();
}
I tried to see the quest journal when the J key was pressed, but I got this error
MissingReferenceException: The object of type 'UnityUIQuestJournalUI' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponent[T] () (at <24d45e813e524a99bfb7a145158a7980>:0)
PixelCrushers.QuestMachine.UnityUIBaseUI.Show ()
i tried ShowJournalUI() too.
++
Can i check Npc have a quest?
I want the code on the bottom to run if Npc doesn't have quests what should I type in A?
A is check npc have a quest
for example)
if( A )
{
return;
}
Debug.Log("Npc dont have quest");
ToggleJournalUI() Error
Re: ToggleJournalUI() Error
Hi,
Leave the player's Quest Journal component's Quest Journal UI field unassigned.
Make sure a valid journal UI is assigned to the Quest Machine GameObject's Quest Machine Configuration > Quest Journal UI field. It's easiest if this journal UI is a child of the Quest Machine GameObject (e.g., in its Canvas).
Leave the player's Quest Journal component's Quest Journal UI field unassigned.
Check QuestGiver.HasOfferableOrActiveQuest():
Code: Select all
QuestGiver questGiver = this.gameObject.GetComponent<QuestGiver>();
if( questGiver.HasOfferableOrActiveQuest() )
{
return;
}
Debug.Log("Npc dont have quest");
Re: ToggleJournalUI() Error
I was gonna do what you said
There's nothing I can put in the Quest Machine Configuration > Quest Journal UI
There's nothing I can put in the Quest Machine Configuration > Quest Journal UI
- Attachments
-
- 20230725_230006.png (51.28 KiB) Viewed 1323 times
Re: ToggleJournalUI() Error
Hi,
It looks like a journal UI is already assigned:
If you want to assign a different one, you will have to drag it into the field. Don't use the circle target in this case.
Make sure no journal UI is assigned to the QuestJournal component.
It looks like a journal UI is already assigned:
If you want to assign a different one, you will have to drag it into the field. Don't use the circle target in this case.
Make sure no journal UI is assigned to the QuestJournal component.
Re: ToggleJournalUI() Error
Quest Journal object have Unity Ui Quest Journal UI and UIPanel components
But the problem hasn't been solved yet
But the problem hasn't been solved yet
- Attachments
-
- 20230725_230006.png (35.79 KiB) Viewed 1316 times
-
- 20230725_231505.png (34.44 KiB) Viewed 1320 times
Re: ToggleJournalUI() Error
Does the Demo scene work properly in your project?
If so, please play your scene in the editor. Just before pressing the 'J' key, inspect the Quest Machine GameObject. Is the Quest Journal UI field still assigned correctly? Is the Quest Journal component's UI Settings > Quest Journal UI field unassigned?
If so, please play your scene in the editor. Just before pressing the 'J' key, inspect the Quest Machine GameObject. Is the Quest Journal UI field still assigned correctly? Is the Quest Journal component's UI Settings > Quest Journal UI field unassigned?
Re: ToggleJournalUI() Error
Yes, The same error occurs in the demo scene.
Re: ToggleJournalUI() Error
Oh i solved the problem
After removing the imported quest machine completely and repeating the import again, the problem was solved
I'm sorry to bother you
After removing the imported quest machine completely and repeating the import again, the problem was solved
I'm sorry to bother you
Re: ToggleJournalUI() Error
Hi,
No worries -- I'm glad it's working now!
No worries -- I'm glad it's working now!