# How to get access to some variable of blueprint which is a part of another blueprint?

**URL:** <https://forums.unrealengine.com/t/how-to-get-access-to-some-variable-of-blueprint-which-is-a-part-of-another-blueprint/1666888>\
**Category:** Programming & Scripting\
**Tags:** access, Variable, interaction, child, unreal-engine, Lighting, Blueprint, question\
**Created:** [February 5, 2024, 1:15am UTC](https://forums.unrealengine.com/t/how-to-get-access-to-some-variable-of-blueprint-which-is-a-part-of-another-blueprint/1666888 "2024-02-05T01:15:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huyfrommount](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huyfrommount](https://forums.unrealengine.com/u/Huyfrommount)\
**Post date:** [February 5, 2024, 1:15am UTC](https://forums.unrealengine.com/t/how-to-get-access-to-some-variable-of-blueprint-which-is-a-part-of-another-blueprint/1666888/1 "2024-02-05T01:15:53Z")

</div>

I have a flashlight blueprint that contains a light source with an intensity variable. I added the flashlight blueprint to the first-person character by dragging the flashlight blueprint into the character blueprint viewport.

The flashlight blueprint follows this scheme (with auto receive input set to player 0).

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/2/6f2bfe1fdbbc99b2e944b1b17c9ad81f20d37b32.png)

While the flashlight dragged into the world reacts to button presses, the flashlight on the character does not.

So, I think I should manipulate the character’s flashlight directly. To do this, I need to somehow get access to the character’s flashlight intensity in the character blueprint. How can I achieve this, or is there another solution?"

---

<div class="post-metadata">

**Author:** ![SkinnyBruv](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skinnybruv/32/878044_2.png) [@SkinnyBruv](https://forums.unrealengine.com/u/SkinnyBruv)\
**Post date:** [February 5, 2024, 2:00am UTC](https://forums.unrealengine.com/t/how-to-get-access-to-some-variable-of-blueprint-which-is-a-part-of-another-blueprint/1666888/2 "2024-02-05T02:00:44Z")

</div>

It appears you are halfway there!

To add the flashlight to a character in Unreal Engine, you can follow these steps:

1. **Create an Actor Component for Flashlight Control:**

- Create a new Blueprint class based on `ActorComponent`. Let’s call it `FlashlightComponent`.
- Add a variable to store the Flashlight Actor.

1. **Attach Flashlight to Character Blueprint:**

- Open your Character Blueprint.
- Add a new component of type `FlashlightComponent` to your character.
- In the `Construction Script` or `Begin Play` event of the Character Blueprint, spawn the Flashlight Actor and set it as the FlashlightComponent’s Flashlight Actor variable.

1. **Control Flashlight State:**

- Add input events in your Character Blueprint to toggle the flashlight on/off.
- In response to these input events, call functions in your `FlashlightComponent` to turn the flashlight on/off.

---

<div class="post-metadata">

**Author:** ![Huyfrommount](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huyfrommount](https://forums.unrealengine.com/u/Huyfrommount)\
**Post date:** [February 5, 2024, 7:43pm UTC](https://forums.unrealengine.com/t/how-to-get-access-to-some-variable-of-blueprint-which-is-a-part-of-another-blueprint/1666888/3 "2024-02-05T19:43:29Z")

</div>

Thanks for the answers, but I found an acceptable solution in this video:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/4/644af1b47faf6a7ec3569e73fd63261c1204475a.jpeg "Tutorial: Actors in Actor - Unreal Engine 4 + Unreal Engine 5") ](https://www.youtube.com/watch?v=ZGICKnkVmVo)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 6, 2024, 7:43pm UTC](https://forums.unrealengine.com/t/how-to-get-access-to-some-variable-of-blueprint-which-is-a-part-of-another-blueprint/1666888/4 "2024-03-06T19:43:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
