Why is this cast failing?

BP_Protagonist is the player character.
image

GetPlayerCharacter can be a nullptr at times - multiplayer servers is one example.
Does it consistently fail - or does it work most of the time?

I changed the reference type to a BP_protagonist, however now i fear if i make a multiplayer it wont work

you can check it with a “IsValid” and reset if it fails…

what do you mean by ‘reset’? whenever i loop it back to the cast when it’s not valid, it just says the same thing

If you’re worried about a reference getting invalided due to multiplayer, test it with the IsValid and set the reference back to “GetPlayerCharacter” if it isn’t…

holy ■■■■ i just realised i dont need to do any of this stuff and i could just use get player character. im so ■■■■■■■ stupid

1 Like

Yeah it’s not slow :slight_smile:

ik im setting it to a reference