# One variable for all characters/actors

**URL:** <https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619>\
**Category:** Programming & Scripting\
**Tags:** variables, Variable, unreal-engine, Blueprint\
**Created:** [February 3, 2024, 12:23am UTC](https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619 "2024-02-03T00:23:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zee\_sea](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zee\_sea](https://forums.unrealengine.com/u/Zee_sea)\
**Post date:** [February 3, 2024, 12:23am UTC](https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619/1 "2024-02-03T00:23:41Z")

</div>

Hi,  
i am really new to ue5, and I am working on my (first) project. I want to make a variable which is defined by a collision box from an actor and the main character should “work” with this variable.  
Is there a way to make a variable that can be used by both the character and the actor? Thank you

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [February 3, 2024, 12:42am UTC](https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619/2 "2024-02-03T00:42:37Z")

</div>

Hey @Zee_sea! Welcome to the forums!

Before you get started with your first project, give this tutorial a shot! It’ll help you get a good, solid base of understanding with Unreal! 🙂

> **[Your First Game In Unreal Engine 5 | Tutorial](https://dev.epicgames.com/community/learning/tutorials/e2V/your-first-game-in-unreal-engine-5)**
>
> Practical in-editor demo making a game from scratch highlighting UE5 features. Show how fast you can create a game leveraging new and established featur...

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 3, 2024, 9:21am UTC](https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619/3 "2024-02-03T09:21:28Z")

</div>

> [@Zee\_sea](#):
>
> Is there a way to make a variable that can be used by both the character and the actor?

Yes, a character inherits from actor:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/c/56cb693154a68144b41df3a230b7fbb4ba92ff8e.png)

If you make the var actor type:

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

You can have it reference any actor, including a character.

* * *

Admittedly, the wording is somewhat confusing - not sure if that’s what you’re after.

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [February 3, 2024, 9:43am UTC](https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619/4 "2024-02-03T09:43:29Z")

</div>

I don’t get what you mean…  
you made an actor with a box collision and a variable,and hope the character(another actor) to get or set the variable?

---

<div class="post-metadata">

**Author:** ![Zee\_sea](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zee\_sea](https://forums.unrealengine.com/u/Zee_sea)\
**Post date:** [February 4, 2024, 10:46am UTC](https://forums.unrealengine.com/t/one-variable-for-all-characters-actors/1661619/5 "2024-02-04T10:46:39Z")

</div>

thank you!
