# How to cast to a blueprint?

**URL:** <https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 17, 2015, 5:14am UTC](https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328 "2015-03-17T05:14:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tryedz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tryedz](https://forums.unrealengine.com/u/Tryedz)\
**Post date:** [March 17, 2015, 5:14am UTC](https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328/1 "2015-03-17T05:14:01Z")

</div>

Hello, I’ve been reading the documentation on blueprint communication and apparently in the latest version (4.7), this feature seems to no longer be present, and neither is the Target Blueprint variable.

So how do I cast to a blueprint now? Or how do I get access to a blueprint’s variables and components, from another blueprint? I couldn’t find any information on this matter.

Thanks

---

<div class="post-metadata">

**Author:** ![Tryedz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tryedz](https://forums.unrealengine.com/u/Tryedz)\
**Post date:** [March 17, 2015, 5:17am UTC](https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328/2 "2015-03-17T05:17:05Z")

</div>

more specifically the “Cast to Target Blueprint” node and “Target Blueprint” variable type seem to be missing

---

<div class="post-metadata">

**Author:** ![Jurif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jurif](https://forums.unrealengine.com/u/Jurif)\
**Post date:** [March 17, 2015, 11:38am UTC](https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328/3 "2015-03-17T11:38:37Z")

</div>

Here’s an example of casting GameMode blueprint to any other blueprint, and saving reference to a new variable.

 ![31933-screenshot362.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/5/da5635d5d488d15ef559802a994b9e06b8b499ce.jpeg)

---

<div class="post-metadata">

**Author:** ![Tryedz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tryedz](https://forums.unrealengine.com/u/Tryedz)\
**Post date:** [March 17, 2015, 4:32pm UTC](https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328/4 "2015-03-17T16:32:25Z")

</div>

Gotcha. Also, is JF\_GameModeBP a Class Blueprint? In case I want to cast between two Class Blueprints how would I do that?

---

<div class="post-metadata">

**Author:** ![Jurif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jurif](https://forums.unrealengine.com/u/Jurif)\
**Post date:** [March 17, 2015, 8:40pm UTC](https://forums.unrealengine.com/t/how-to-cast-to-a-blueprint/311328/5 "2015-03-17T20:40:28Z")

</div>

Well classes are recipes how to create objects, when in game you’re looking at objects.  
JF\_GameModeBP is a blueprint having GameMode class as parent.  
In this case is an object type, it’s already cooked and running in the game:).

The point is that only one GameMode exists so you can always get it from any blueprint using GetGameMode function as seen on screenshot.  
This makes it easy to access all GameMode content from other blueprints.

To cast between other blueprints all you need to have is a reference, for example once the game starts there could be many characters or some objects in game, if you’d try to cast it to lets say HUD blueprint,  
how would you figure out which one of them you want?  
So this is the only problem, you need a reference.

Lets say above picture is casting a GameMode blueprint to Character blueprint,  
that means at begin play all the characters will first get reference to the GameMode.  
Then you could set it up so that when a character is clicked you would save reference to self into a GameMode blueprint,

GameModeVariable-\>ClickedCharacter = this; (self).

So now other blueprints can get this reference from GameMode blueprint in same way and GameMode will remember it until is changed again or until end of the game session.  
Of course you first need to create a ClickedCharacter (blueprint) object type variable in GameMode.

Good Luck 😉
