# Define static variable won't launch a Standalone Game

**URL:** <https://forums.unrealengine.com/t/define-static-variable-wont-launch-a-standalone-game/464079>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 22, 2020, 11:20am UTC](https://forums.unrealengine.com/t/define-static-variable-wont-launch-a-standalone-game/464079 "2020-04-22T11:20:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![EXP\_EXE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EXP\_EXE](https://forums.unrealengine.com/u/EXP_EXE)\
**Post date:** [April 22, 2020, 11:20am UTC](https://forums.unrealengine.com/t/define-static-variable-wont-launch-a-standalone-game/464079/1 "2020-04-22T11:20:28Z")

</div>

1. Create C ++ Project

2. Create a C ++ actor class (AMyActor)

3. Add static variable code to cpp

4. Build

5. Play a standalone game

6. Crash

Running it in the “editor window” works fine.

 ![300280-crash.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/7/d97798c6ee41d72a1707d058e4e448049c452d4c.jpeg)

[link text][2]
