# How can I call a function inside the gamemode from the character in blueprint?

**URL:** <https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281>\
**Category:** Blueprint\
**Tags:** gamemode, calling-a-function, unreal-engine, UE4, Blueprint, question\
**Created:** [July 6, 2015, 5:46pm UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281 "2015-07-06T17:46:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chef\_Seth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chef\_Seth](https://forums.unrealengine.com/u/Chef_Seth)\
**Post date:** [July 6, 2015, 5:46pm UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281/1 "2015-07-06T17:46:56Z")

</div>

Every time I cast to the Gamemode and then call the function, the cast fails, what’s happening?

---

<div class="post-metadata">

**Author:** ![rXp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rXp](https://forums.unrealengine.com/u/rXp)\
**Post date:** [July 6, 2015, 6:33pm UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281/2 "2015-07-06T18:33:47Z")

</div>

Hi,

Did you set your custom game mode in the world settings ?

---

<div class="post-metadata">

**Author:** ![Chef\_Seth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chef\_Seth](https://forums.unrealengine.com/u/Chef_Seth)\
**Post date:** [July 7, 2015, 6:09am UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281/3 "2015-07-07T06:09:48Z")

</div>

Yeah I set it, the gamemode is running all it’s code fine, casting just doesn’t seem to be working properly…

---

<div class="post-metadata">

**Author:** ![rXp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rXp](https://forums.unrealengine.com/u/rXp)\
**Post date:** [July 7, 2015, 6:53am UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281/4 "2015-07-07T06:53:57Z")

</div>

It weird… Do you load new map during the map ? And also does the cast fail everywhere ?

---

<div class="post-metadata">

**Author:** ![Chef\_Seth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chef\_Seth](https://forums.unrealengine.com/u/Chef_Seth)\
**Post date:** [July 7, 2015, 4:22pm UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281/5 "2015-07-07T16:22:42Z")

</div>

I don’t load a new map, and I think the cast fails everywhere, but what do you mean by that? It fails every time I call it

---

<div class="post-metadata">

**Author:** ![Chef\_Seth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chef\_Seth](https://forums.unrealengine.com/u/Chef_Seth)\
**Post date:** [July 7, 2015, 5:22pm UTC](https://forums.unrealengine.com/t/how-can-i-call-a-function-inside-the-gamemode-from-the-character-in-blueprint/324281/6 "2015-07-07T17:22:19Z")

</div>

After doing some tests, it seems like casting to anything isn’t working properly, and I can’t get it to work with interfaces either. All I’m trying to do is move the character to a different place when a function inside of the gamemode is called, also when some actors spawn other actors I need those to be added to an array in the gamemode, but the cast never goes through when I try to do either of those. The picture is all the different methods I’ve tried for the player respawning

 ![49407-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/d/b4de55119e72956569876f8e2c2ac41b0c48f30e.png)
