# How to reference a FirstPersonCharacter in the Player Controller BP?

**URL:** <https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, UE4-27, Blueprint, question\
**Created:** [May 1, 2022, 8:52pm UTC](https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977 "2022-05-01T20:52:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom8788](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tom8788](https://forums.unrealengine.com/u/Tom8788)\
**Post date:** [May 1, 2022, 8:52pm UTC](https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977/1 "2022-05-01T20:52:11Z")

</div>

In my Player Controller BP, I’m trying to implement code to switch between a FirstPersonCharacter and a SpectatorPawn with a Possess node. I can reference the SpectatorPawn easily (Cast to SpectatorPawn, using GetPlayerPawn as object ref), but I cannot reference the FirstPersonCharacter (using Cast to FirstPersonCharacter, with Get PlayerCharacter as object ref).

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/9/8d9b22b7e166b33eed4d9475b5b1305477ef88b1.png)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![real.dude](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@real.dude](https://forums.unrealengine.com/u/real.dude)\
**Post date:** [May 1, 2022, 10:09pm UTC](https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977/2 "2022-05-01T22:09:57Z")

</div>

When you are in `SpectatorPawn` `GetPlayerCharacter` will return null.  
Simply store a reference to your `FirstPirsonCharacter` before un possessing and then posses in it

---

<div class="post-metadata">

**Author:** ![Tom8788](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tom8788](https://forums.unrealengine.com/u/Tom8788)\
**Post date:** [May 2, 2022, 7:42am UTC](https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977/3 "2022-05-02T07:42:39Z")

</div>

Thanks for your reply, but as you can see my question: “How do I store the reference to my FirstPersonCharacter”? So, how do I do that?

---

<div class="post-metadata">

**Author:** ![Tom8788](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tom8788](https://forums.unrealengine.com/u/Tom8788)\
**Post date:** [May 2, 2022, 8:02am UTC](https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977/4 "2022-05-02T08:02:12Z")

</div>

Okay, sorry, I think I get it. I’ll try to create the ref in Event Begin Play as first thing, and then see what happens. Thanks again.

---

<div class="post-metadata">

**Author:** ![Tom8788](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tom8788](https://forums.unrealengine.com/u/Tom8788)\
**Post date:** [May 2, 2022, 8:28pm UTC](https://forums.unrealengine.com/t/how-to-reference-a-firstpersoncharacter-in-the-player-controller-bp/545977/5 "2022-05-02T20:28:34Z")

</div>

@real.dude, your suggestion worked, thanks a million!
