# Help improving a Player within Actor bounds test

**URL:** <https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203>\
**Category:** Blueprint\
**Tags:** actor-blueprint, actor-location, unreal-engine, Blueprint, question\
**Created:** [August 22, 2018, 12:09pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203 "2018-08-22T12:09:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoneScrapbot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LoneScrapbot](https://forums.unrealengine.com/u/LoneScrapbot)\
**Post date:** [August 22, 2018, 12:09pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203/1 "2018-08-22T12:09:05Z")

</div>

Hello UE4 community,

can anyone advise me on how I can improve my Player is within Actor Bounds test? I’m getting occasional Blueprint runtime errors when the Get Player Pawn evaluates to: None. This test is used to control doors on a dynamically resizing actor to prevent them locking while the player is on the wrong side.

```
Blueprint Runtime Error: Accessed None trying to read property CallFunc_GetPlayerPawn_ReturnValue from function: 'ExecuteUbergraph_A100001' from node: Set Player_Inside_Maze in graph: EventGraph in object: A100001 with description: Accessed None trying to read property CallFunc_GetPlayerPawn_ReturnValue

```

It still works as intended, but I don’t like having errors if I can avoid it. The none property appears to happen before gameplay actually starts. So I am guessing that it is happening in a brief moment before the player pawn exists. The boolean output is tested on an overlap event that (at the time) had not been triggered.

 ![251256-insidemazeboundstest.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/6/95674c349c2749d8fb67c2d77388290a94afee52.png)

Any thoughts on how I might do this better or prevent that error being generated? Thanks in advance! 🙂

---

<div class="post-metadata">

**Author:** ![xSheim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xSheim](https://forums.unrealengine.com/u/xSheim)\
**Post date:** [August 22, 2018, 12:20pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203/2 "2018-08-22T12:20:30Z")

</div>

Before checking your condition, you can check whether the Pawn is valid, like so:

 ![251258-pawnisvalid.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/c/78c4959c34cb6c9c6790b3e3ace7d3681245cf1f.png)

---

<div class="post-metadata">

**Author:** ![xSheim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xSheim](https://forums.unrealengine.com/u/xSheim)\
**Post date:** [August 22, 2018, 12:27pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203/3 "2018-08-22T12:27:57Z")

</div>

But according to your condition, wouldn’t it be easier to use a volume for this check [Volumes Reference | Unreal Engine Documentation](https://docs.unrealengine.com/en-us/Engine/Actors/Volumes)?

---

<div class="post-metadata">

**Author:** ![LoneScrapbot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LoneScrapbot](https://forums.unrealengine.com/u/LoneScrapbot)\
**Post date:** [August 22, 2018, 12:43pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203/4 "2018-08-22T12:43:12Z")

</div>

Hi xSheim. Quite possibly.

I did it this way because the actor (a maze) I need to test is dynamically generated and resizes constantly during gameplay on a single level map.

In order to use a volume I’m assuming I’d need to match it to the Maze actors bounds (minus some padding) dynamically every time the maze’s re-generate function fires. It isn’t something I had considered or investigated. If I were to do it that way, there may be future use for a Nav Mesh Volume if that would work. I really have no idea how to use them yet though.

I’m pretty green. 😉

---

<div class="post-metadata">

**Author:** ![LoneScrapbot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LoneScrapbot](https://forums.unrealengine.com/u/LoneScrapbot)\
**Post date:** [August 22, 2018, 12:50pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203/5 "2018-08-22T12:50:44Z")

</div>

Bam.

Adding an IsValid check on the Player Pawn has stopped the error. Thank you so much. 🙂 Now I can live with my (quite possibly terrible) inside bounds test!

---

<div class="post-metadata">

**Author:** ![xSheim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xSheim](https://forums.unrealengine.com/u/xSheim)\
**Post date:** [August 22, 2018, 1:54pm UTC](https://forums.unrealengine.com/t/help-improving-a-player-within-actor-bounds-test/432203/6 "2018-08-22T13:54:08Z")

</div>

Glad it helped. You can attach a volume to your actor (to detect overlaps you can use the Trigger Volume) and then dynamic resizing wouldn’t be a problem. But I think it would be a different-topic question. As for the Nav Mesh you mentioned, it could help: [https://answers.unrealengine.com/questions/223395/dynamic-navigation-mesh.html](https://answers.unrealengine.com/questions/223395/dynamic-navigation-mesh.html)
