I add the quest to the log, but the ref to the quest is valid.
then I change the variable… and now this ref is not valid.
(LEVEL BLUEPRINT)
I honestly have no idea why. Help pls…
I add the quest to the log, but the ref to the quest is valid.
I honestly have no idea why. Help pls…
AQuestActor * ActiveQuest exists only from within the scope of the function in the second picture. (not sure if that is the constructor or another function).
AQuestActor * ActiveQuest should reside as UPROPERTY defined in the header of the file so that it has the maximum scope of the class that it resides in. Then you should be able to set it and access it from within the function.
Right now once the second pictures function call ends the ActiveQuest variable is destroyed.
QuestLogComponent->ActiveQuest return nullptr value…
ActiveQuest defined UPROPERTY in QuestLogComponent
Added the call to the c++ function:
The c++ part finds the correct active quest (made in the questcomponent to not make a separate class but it has the global search through gameplaystatics)
ahhahahahahha, I’m so sorry… I found a mistake, I’m doing a cast to the gamemode… and I have a completely different one on the map.
I would never have thought of it if it wasn’t for one accident.
Thanks for your help
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.