Hello! I’ve made a simple set up for the main character of my project to switch between other characters. I use an even dispatcher in order for the main character to call the event from the third person game mode.
The issue im running into is that the main character (Character A) can switch to the other characters but when i set up the nodes for the other two characters (B and C), i get this error :
Blueprint Runtime Error: “Accessed None trying to read property As BP Third Person Game Mode”. Node: Character Toggle A Event Graph: EventGraph Function: Execute Ubergraph BP CharacterB Blueprint: BP_CharacterB
I tried out your set up and its works well except im getting the same result. Character 1 can switch to 2 and 3 but when trying to switch again, i get that Accessed None trying to read property" error again
I changed the nodes you had a bit to work but they are only working for character 1. Even when i try to put the other 2 characters as default pawns, i still get that same error. Any idea what could be making the pawns not able to read the nodes?
I most likely did not. i took the input pin of “Asset Class” and promoted it into a variable. This is the first time i’ve heard of soft/hard references.
so if im doing things correctly, i’d assume i would need to make a soft class reference to the character 1 in order for the other characters to be able to switch?
Yes the “Characters” array should contain soft references to the characters you can posses. You can either pre-polulate it with default values or change it during gameplay.
Blueprint Runtime Error: “Accessed None trying to read property As BP Third Person Game Mode”. Node: Set Character Index Graph: EventGraph Function: Execute Ubergraph BP Mechanic Girl Blueprint: BP_MechanicGirl
(Mechanic girl is character 2)
Character 1 can switch to character 2 but the error comes up only when trying to switch back or to character 3. This is the set up in character 2’s event graph
Ok so during begin play are you getting the game mode and casting it to “BPThirdpersonGameMode” and setting the resulting cast object as the variable BPThirdpersonGameMode?
If not you have an empty variable that is not initialized. Hence it would be seen as “None”