# Reference to variable in game map

**URL:** <https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 15, 2020, 12:58am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353 "2020-09-15T00:58:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stackmetsu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stackmetsu](https://forums.unrealengine.com/u/Stackmetsu)\
**Post date:** [September 15, 2020, 12:58am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353/1 "2020-09-15T00:58:28Z")

</div>

Hello 🙂

I’m trying to program a game with blueprint only. On each map, there are 3 camps where characters can be teleport if they hit another character. I define the spawns with PlayerStarts (from 1 to 5, for each camp) in each level blueprint of the map. To gain time, I would like to set events in my GameMode where it says :  
If a character hit another one, teleport (with conditions) to the playerstart 1 of this camp in this map.

My issue is I don’t know how to refer to a level blueprint map… Anyone can help me? 🙂

Thanks for all !

---

<div class="post-metadata">

**Author:** ![Okarii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Okarii](https://forums.unrealengine.com/u/Okarii)\
**Post date:** [September 15, 2020, 1:08am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353/2 "2020-09-15T01:08:10Z")

</div>

Unfortunately you cannot cast to the level blueprint, period. This is just not possible. you will want to instead put this logic into your game mode blueprint. Heres the documentation page to get you started on changing the game mod: [https://docs.unrealengine.com/en-US/Gameplay/HowTo/SettingUpAGameMode/Blueprints/index.html](https://docs.unrealengine.com/en-US/Gameplay/HowTo/SettingUpAGameMode/Blueprints/index.html)

---

<div class="post-metadata">

**Author:** ![Stackmetsu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stackmetsu](https://forums.unrealengine.com/u/Stackmetsu)\
**Post date:** [September 15, 2020, 1:44am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353/3 "2020-09-15T01:44:29Z")

</div>

I understand, thank you ! 🙂

I guess I need to create a character Blueprint per maps, to change the values of spawn points 🙂

---

<div class="post-metadata">

**Author:** ![Okarii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Okarii](https://forums.unrealengine.com/u/Okarii)\
**Post date:** [September 15, 2020, 1:54am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353/4 "2020-09-15T01:54:42Z")

</div>

So that is why I recommend the game mode blueprint. if the basic logic that occurs at the beginning is a get all actors (player start) you can create a function that any actor can call using a get gamemode node, which is very convenient, and it can call/request a respawn.

The game mode is ideal for this since once you create this logic and player interaction for one map. as long as you use the same gamemode in the other maps everything will work out just fine. so you will need to create the mechanics once, and then can use them in any number of maps as long as they have player starts.

![313563-gamemode.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/5/d/75d2e82ac41917e21786fe0889571b3d1cfe03e7.png)

---

<div class="post-metadata">

**Author:** ![Stackmetsu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stackmetsu](https://forums.unrealengine.com/u/Stackmetsu)\
**Post date:** [September 15, 2020, 1:56am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353/5 "2020-09-15T01:56:24Z")

</div>

Thanks a lot 🙂 May I contact you if i have any question on UE4 ? (I’ve really novice but I learn quickly) !

---

<div class="post-metadata">

**Author:** ![Okarii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Okarii](https://forums.unrealengine.com/u/Okarii)\
**Post date:** [September 15, 2020, 1:58am UTC](https://forums.unrealengine.com/t/reference-to-variable-in-game-map/471353/6 "2020-09-15T01:58:25Z")

</div>

feel free to keep posting the issues that come up via replies with this particular mechanic thing as your making it, and we can give you feedback/help as your progressing through it. That will keep the process organized and novices in the future will have a breadcrumb trail to follow as well!
