# Trigger volume Reference Instance editable variable

**URL:** <https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000>\
**Category:** UI\
**Tags:** unreal-engine, question\
**Created:** [January 18, 2025, 4:24am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000 "2025-01-18T04:24:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MARZ64331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MARZ64331](https://forums.unrealengine.com/u/MARZ64331)\
**Post date:** [January 18, 2025, 4:24am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/1 "2025-01-18T04:24:46Z")

</div>

I need help creating an instance editable variable to reference the existing Trigger Volume in the level. I am not sure how to assign the reference in the Level Editor. Also, how do I use the OnActorBeginOverlap and OnActorEndOverlap events of the Trigger Volume to turn the UI on and off? I need to cast the Other Actor to BP\_Bot with the appropriate OnActorBeginOverlap event so that only the player can activate the UI by walking into the studio. For the OnActorEndOverlap event, how do I cast the Other Actor to BP\_Bot so that only the player can deactivate the UI? I have figured it out, but I have a new problem my trigger volume reference doesn’t work with the trigger volume

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 18, 2025, 8:34am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/2 "2025-01-18T08:34:21Z")

</div>

I would suggest not casting to the bot. Select the bot actor in your content browser and give him an actor tag “bot” and then on the overlap check if actor has the tag.  
Have you player use the actor tag player and then no casts are needed.

Edit: fixed up ui reference to not be time dependant

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/9/4a9b68bd97c8d2ca357fb5daf9b849122ce273e4.png)

Hud reference init

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/3/1/931165a7e8b9cb4b8033d71231a59ae198837665.png)

Inside of your hud class create the widget

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/e/47e36d9b16932b10d8647518552801ecb08b4c4e.png)

Remember to add the proper tags to the actors

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/6/c5685ad7fefc9e61476fe5cdf790ca9e897c317c.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/e/88e1fb34c9ce31326b324b9a6bd4b3012839b61a.png)

I’m guessing the bot is supposed to be possessed by the player to activate / deactivate these widgets?

Edit: this will work only for standalone games though as the trigger lives on the server in mp games and can’t access the player hud then. You would need more complex logic then.

---

<div class="post-metadata">

**Author:** ![MARZ64331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MARZ64331](https://forums.unrealengine.com/u/MARZ64331)\
**Post date:** [January 18, 2025, 10:28am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/3 "2025-01-18T10:28:22Z")

</div>

I am doing an assignment and the instructions said to cast to bot but when I do so it does not activate the UI when I walk on the Trigger Volume, nor does it deactivate when I walk out of the trigger volume,

 ![Screenshot 2025-01-18 052744](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/2/b620b27fb6e29ffcf231a126c597d5914a464602.png)  
I am wondering what the problem is because I must use cast to bot for the assignment.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 18, 2025, 11:13am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/4 "2025-01-18T11:13:46Z")

</div>

Is your player character set to the BP\_Bot?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 18, 2025, 11:21am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/5 "2025-01-18T11:21:45Z")

</div>

Make sure your game mode in your project settings =\> “maps and modes” set the default player correctly to BP\_Bot

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/e/86e309055e18b4c4b49413c2fb96d605c8a4f34d.png)

It should pass the cast correctly

overlap

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/4/bb4b1191ba6bf1f557303f6ea53127fed1f210d1.png)  
end overlap  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/3/9e378b75ab47d613e70e2598ffb1f4b6124d29ea.png)

As for setting the widget reference inside of a blueprint function library, you need to make a function that takes in an input of type widget then you need

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/4/e040f258c661f38684c5125181511cf80fa67acf.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/6/b76a0a066b6e72f9c65ff1345461d80141680f3e.png)

Revised hud and functions to work with a bp library

Hud:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/6/9261fe9c8d7bf79ab0fdd45eff2732c25c93ac13.png)

Activate

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/e/d9efab1edc4fc41eec3ebbc64875ed91217709ea.png)  
Deactivate  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/5/c45c5db4afa959a9d0d24db5cc776abe3139e2b0.png)

---

<div class="post-metadata">

**Author:** ![MARZ64331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MARZ64331](https://forums.unrealengine.com/u/MARZ64331)\
**Post date:** [January 19, 2025, 1:48am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/6 "2025-01-19T01:48:01Z")

</div>

Is it not working because the player is a pawn?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 19, 2025, 9:06am UTC](https://forums.unrealengine.com/t/trigger-volume-reference-instance-editable-variable/2284000/7 "2025-01-19T09:06:49Z")

</div>

The only actor where the cast will work for the trigger is BP\_Bot, because that is what you are trying to cast to
