# Making a variable accesible to other blueprints

**URL:** <https://forums.unrealengine.com/t/making-a-variable-accesible-to-other-blueprints/402399>\
**Category:** Blueprint\
**Tags:** variables-communicat, unreal-engine, clamp, Blueprint, question\
**Created:** [August 21, 2017, 10:04am UTC](https://forums.unrealengine.com/t/making-a-variable-accesible-to-other-blueprints/402399 "2017-08-21T10:04:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ekarasakal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ekarasakal](https://forums.unrealengine.com/u/ekarasakal)\
**Post date:** [August 21, 2017, 10:04am UTC](https://forums.unrealengine.com/t/making-a-variable-accesible-to-other-blueprints/402399/1 "2017-08-21T10:04:46Z")

</div>

Hello Unreal Community this is my very first post.

My question is: I am planning to make a side scroller 3d shoot em up game. I want to be able to limit my spacefighter Up/Down movement relative to my fixed cams frustum at the spacefighters distance.  
and required mathematical formulas for computing frustum height min/max is as follows  
tan(verticalFOV/2)_distance  
verticalFov=2_atan(tan(horizantalFov/2)\*height/width)  
i created camera and placed it to scene center and converted it to a camera component blueprint and computed my frustum height  
the problem here is i want my Pawn movement to be clamped between frustum height. but i am not able to transfer the frustum height information that i was computed from camera component blueprint to my spacefighters blueprint.

any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Aphermion](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aphermion/32/538920_2.png) [@Aphermion](https://forums.unrealengine.com/u/Aphermion)\
**Post date:** [August 21, 2017, 10:35am UTC](https://forums.unrealengine.com/t/making-a-variable-accesible-to-other-blueprints/402399/2 "2017-08-21T10:35:25Z")

</div>

You could Get all actors from class space fighter (or whatever name it has) on begin play inside the camera component blueprint and then cast the variable you want the space fighter to receive, to the space fighter with the “cast to” node on event tick.  
I don’t know how cost efficient this is, but I think it should to the job.

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 21, 2017, 11:39am UTC](https://forums.unrealengine.com/t/making-a-variable-accesible-to-other-blueprints/402399/3 "2017-08-21T11:39:04Z")

</div>

Store your refference or just the result somewhere easy to access like GameMode/GameInstance or even your Controller.

BeginPlay → getGameInstance → CastTo YourGameInstance → Set VariableNameYouChoose and pass self (YourBP or Component that has the Variable you want to get) or just the Result after you calculated it.

Inside your Fighter you get the Variable from there when you need it. No need for get all Actors of Class and it will work with dynamicly spawned Fighters out of the Box.

BeginPlay → getGameInstance → CastTo YourGameInstance → Get VariableNameYouChoose

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 21, 2017, 11:45am UTC](https://forums.unrealengine.com/t/making-a-variable-accesible-to-other-blueprints/402399/4 "2017-08-21T11:45:45Z")

</div>

Additional recomanded Training Video:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/4/c04b72f0c2350fe16cce0a9795c662a495694f67.jpeg "Blueprint Communications | Live Training | Unreal Engine") ](https://www.youtube.com/watch?v=EM_HYqQdToE)
