hi I’ve already read a bunch of other posts about this but haven’t been able to find an answer so i figured i would just ask. i’m trying to get it to print a value from TPC(third person character) on my main menu but it errors out when ever i bring up the menu with accessed none ‘TPC’ from node Return node in graph 'GetText_0 in blueprint W_main_menu. the first picture is the main menu script for, the second is TPC, and the last is what i use from tracing
Where is the accessed none error ?
accessed none ‘TPC’ from node Return node in graph 'GetText_0 in blueprint W_main_menu.
Thanks for the clarification
Two things spring to mind here,
1- either the TPC variable is not initialized before the getText_0 is firing
2- or the TPC is not correct because your game mode override is different in the main menu level (if it’s different)?
Hope this helps.
If it is that TPC isnt initailalized how would i fix that.
No where do I actually see you Set the TPC variable. ‘Access None’ typically means there is no live object stored in the variable ('Access None: Pending Kill means it was live at one point but has been marked for deletion before the call.)
Declaring a variable to a particular type does not set it, it only tells the compiler that this is the thing you want to use this variable for. You need to Set a live instance of an object into the variable.
Getting access to the TPC should be easy and straight forward. In the Blueprint you are calling/using the TPC variable, in the Begin Play get the ‘Get Player Character’ node (right-click in empty graph), then drag off the output pin and type ‘Cast To’ and select the one that matches the character you are using (example ‘Cast To Third Person Character’) then plug the output pin of the cast into a ‘Set’ node for your TPC variable.
Hope this helps! If it does, please do me a favor and accept the answer by clicking the checkmark next to the answer. You’ll know you got it right if the answer turns Green. Note that making any comments after accepting the answer will unaccept the answer! Thanks and Good Luck!
Jesse