How can I get a character from a playerstate?

dellis23
Thu, 23 Jul 2020 02:53:35 +0000
World Creation

I’m using a custom PlayerState. When a PlayerState is created, I’d like to find the associated character and update its collision profile. Essentially I’m trying to set a different collision profile for each player in the game.

I’m using the first person starter content as a starter point. I’ve tried doing PlayerState->GetOwner->Cast To FirstPersonCharacter, but this fails. I see a GetPawn function here, but it doesn’t appear to be exposed in blueprints. Is there another way to do this? Is there a better way? I had little success getting it to work in the FirstPersonCharacter event graph, even after monkeying around with Switch Has Authority, but I may have done something wrong.

4 posts - 2 participants