# Can't access gameState or gamemode

**URL:** <https://forums.unrealengine.com/t/cant-access-gamestate-or-gamemode/387089>\
**Category:** Blueprint\
**Tags:** gamemode, game-state, unreal-engine, Blueprint, CPP, question\
**Created:** [March 6, 2017, 12:41pm UTC](https://forums.unrealengine.com/t/cant-access-gamestate-or-gamemode/387089 "2017-03-06T12:41:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f7c0f7221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f7c0f7221](https://forums.unrealengine.com/u/anonymous_user_f7c0f7221)\
**Post date:** [March 6, 2017, 12:41pm UTC](https://forums.unrealengine.com/t/cant-access-gamestate-or-gamemode/387089/1 "2017-03-06T12:41:58Z")

</div>

Hi,

I derived a blueprint class from a cpp class (which itself derives from UObject).

I am trying to access either GameState or GameMode in that blueprint but it doesn`t show up on the menu. I also tried to create that node in a different blueprint and copy it to the first blueprint but it doesn`t show up.

Can anyone point me the problem?

---

<div class="post-metadata">

**Author:** ![Mosel3y](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mosel3y](https://forums.unrealengine.com/u/Mosel3y)\
**Post date:** [March 6, 2017, 1:31pm UTC](https://forums.unrealengine.com/t/cant-access-gamestate-or-gamemode/387089/2 "2017-03-06T13:31:51Z")

</div>

It’s because you are inheriting from UObject, which doesn’t have access to those, it can’t use functions requiring a reference to the World. You could inherit from Actor instead, unless there is a specific reason you don’t want to?

If you need to do it this way try adding meta = (ShowWorldContextPin) to your UCLASS declaration.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f7c0f7221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f7c0f7221](https://forums.unrealengine.com/u/anonymous_user_f7c0f7221)\
**Post date:** [March 6, 2017, 2:02pm UTC](https://forums.unrealengine.com/t/cant-access-gamestate-or-gamemode/387089/3 "2017-03-06T14:02:47Z")

</div>

Yea I needed it to be like that. Thank you, that configuration solved it.
