# Ongoing C++ Gameplay Example Series: Making a Survival Game

**URL:** <https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878>\
**Category:** Announcements\
**Tags:** unreal-engine\
**Created:** [March 20, 2015, 3:38pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878 "2015-03-20T15:38:03Z")\
**Posts on this page:** 20\
**Page:** 15

<div class="post-metadata">

**Author:** ![anonymous\_user\_be8739da](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_be8739da](https://forums.unrealengine.com/u/anonymous_user_be8739da)\
**Post date:** [October 7, 2016, 9:14pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/292 "2016-10-07T21:14:44Z")

</div>

open up the class you inherit from -\>cameraboom.h or whatever and look around for a setter function, use that instead of accessing the variables directly

---

<div class="post-metadata">

**Author:** ![Max\_Sam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Max\_Sam](https://forums.unrealengine.com/u/Max_Sam)\
**Post date:** [October 10, 2016, 11:28pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/293 "2016-10-10T23:28:58Z")

</div>

Hi,  
First, thanks a lot for this example, that makes me learn so much more about UE4 C++.

I’m trying to understand how can I put different “holding weapons animations” for each weapon type, but I’m not a programmer, I’m a Designer lol.

Can you point me in the right direction for doing this thing?  
I’ve tryed to put some bool on OnPrimaryEquip…, but it can’t work at all.

Very sorry for my english, I wish you understand what I want to say.

---

<div class="post-metadata">

**Author:** ![mblogest](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mblogest](https://forums.unrealengine.com/u/mblogest)\
**Post date:** [October 13, 2016, 11:02am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/295 "2016-10-13T11:02:41Z")

</div>

i have unreal 4.12 and i have not older version of engine.how to use this project ? beacuse when run it,he say surrvival game.dll bult with another version .and rebuild from source.how to rebuild or use it???please help

---

<div class="post-metadata">

**Author:** ![mblogest](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mblogest](https://forums.unrealengine.com/u/mblogest)\
**Post date:** [October 19, 2016, 11:05am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/296 "2016-10-19T11:05:45Z")

</div>

hi and thanks for every thing.  
when i convert your project with 4.13 event graph not loaded in blue print and no showing any thing.why?

---

<div class="post-metadata">

**Author:** ![mblogest](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mblogest](https://forums.unrealengine.com/u/mblogest)\
**Post date:** [October 19, 2016, 8:25pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/297 "2016-10-19T20:25:08Z")

</div>

why other blueprint or c++ class dont compile like blueprint?

---

<div class="post-metadata">

**Author:** ![davidgutjar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davidgutjar](https://forums.unrealengine.com/u/davidgutjar)\
**Post date:** [November 4, 2016, 11:12am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/298 "2016-11-04T11:12:38Z")

</div>

when hit more than one spacebar key player flying to the sky 🙂  
how fix that ?

---

<div class="post-metadata">

**Author:** ![acxsasx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@acxsasx](https://forums.unrealengine.com/u/acxsasx)\
**Post date:** [November 6, 2016, 8:39pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/299 "2016-11-06T20:39:12Z")

</div>

> [@davidgutjar;618883](#):
>
> when hit more than one spacebar key player flying to the sky 🙂  
> how fix that ?

4.13.2.

I don’t know if this is the best way, but it works for me at the moment.

In your SCharacter.cpp (or whatever you named yours)

void ASCharacter::OnStopJump()  
{  
bPressedJump = false;  
StopJumping();  
}

---

<div class="post-metadata">

**Author:** ![SuperheroHill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SuperheroHill](https://forums.unrealengine.com/u/SuperheroHill)\
**Post date:** [November 11, 2016, 7:05pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/300 "2016-11-11T19:05:41Z")

</div>

This project is SUPER INSPIRING and I’m soo excited to try it out!! My question is though, what is the license and could the license please be included in the git? Thank you so much for all of your hard work on this!

---

<div class="post-metadata">

**Author:** ![LanceJZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LanceJZ](https://forums.unrealengine.com/u/LanceJZ)\
**Post date:** [November 25, 2016, 4:11am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/302 "2016-11-25T04:11:59Z")

</div>

I just got 4.13.2 downloaded and installed, and I opened your project in it, and I get this error.

[https://s12.postimg.org/dywdlziil/Unreal\_Survival\_Game\_error.png](https://s12.postimg.org/dywdlziil/Unreal_Survival_Game_error.png)

Is a file missing? Where can I find it?

---

<div class="post-metadata">

**Author:** ![iLexLOL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iLexLOL](https://forums.unrealengine.com/u/iLexLOL)\
**Post date:** [November 26, 2016, 10:21pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/303 "2016-11-26T22:21:24Z")

</div>

Hey thumbs up man! But i really cant seem to know whats causing infinite jumping glitch , tried donwloading the project 2 times (using 4.13 version) , could you please please update it with the fix on GitHub? I would love to \<3

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [November 28, 2016, 12:34am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/304 "2016-11-28T00:34:23Z")

</div>

> [@Luc4m4rio;629106](#):
>
> Hey thumbs up man! But i really cant seem to know whats causing infinite jumping glitch , tried donwloading the project 2 times (using 4.13 version) , could you please please update it with the fix on GitHub? I would love to \<3

Just uploaded a fix for this infinite jumping glitch to GitHub.

> [@LanceJZ;628443](#):
>
> I just got 4.13.2 downloaded and installed, and I opened your project in it, and I get this error.
> 
> [https://s12.postimg.org/dywdlziil/Unreal\_Survival\_Game\_error.png](https://s12.postimg.org/dywdlziil/Unreal_Survival_Game_error.png)
> 
> Is a file missing? Where can I find it?

I get the same error, not quite sure why it’s failing to import. Afaik everything still works though.

---

<div class="post-metadata">

**Author:** ![0bas0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0bas0](https://forums.unrealengine.com/u/0bas0)\
**Post date:** [November 28, 2016, 2:22pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/305 "2016-11-28T14:22:11Z")

</div>

Hey question? is this gonna get updated to 4.14? I tried it myself but I am not that much of a code wizard ^^

---

<div class="post-metadata">

**Author:** ![nemesis567](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nemesis567](https://forums.unrealengine.com/u/nemesis567)\
**Post date:** [November 30, 2016, 5:12am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/306 "2016-11-30T05:12:38Z")

</div>

> [@](#):
>
> Running C:/Program Files (x86)/Epic Games/4.14/Engine/Binaries/DotNET/UnrealBuildTool.exe SurvivalGame Development Win64 -project=”C:/Users/Kavan/Documents/Unreal Projects/SurvivalGame 4.14/SurvivalGame.uproject” -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE  
> @progress push 5%  
> Parsing headers for SurvivalGameEditor  
> Running UnrealHeaderTool “C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\SurvivalGame.uproject” “C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Intermediate\Build\Win64\SurvivalGameEditor\Development\SurvivalGameEditor.uhtmanifest” -LogCmds=”loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed  
> Reflection code generated for SurvivalGameEditor in 4.9968581 seconds  
> @progress pop  
> Performing 6 actions (4 in parallel)  
> [2/6] Resource ModuleVersionResource.rc.inl  
> [3/6] Resource SurvivalGame.rc  
> PCH.SurvivalGame.h.cpp  
> Module.SurvivalGame.cpp  
> SurvivalGame.generated.cpp  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\Player\SBaseCharacter.cpp(101): error C2039: ‘GetMatchState’: is not a member of ‘AGameModeBase’  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\GameFramework/GameStateBase.h(10): note: see declaration of ‘AGameModeBase’  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\Player\SPlayerController.cpp(31): error C2248: ‘UWorld::GameState’: cannot access private member declared in class ‘UWorld’  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\Engine/World.h(780): note: see declaration of ‘UWorld::GameState’  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime/Engine/Classes/Animation/AnimInstance.h(24): note: see declaration of ‘UWorld’  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\Player\SPlayerState.cpp(41): error C2248: ‘UWorld::GameState’: cannot access private member declared in class ‘UWorld’  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\Engine/World.h(780): note: see declaration of ‘UWorld::GameState’  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime/Engine/Classes/Animation/AnimInstance.h(24): note: see declaration of ‘UWorld’  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(9): error C2011: ‘FLogCategoryLogGameMode’: ‘struct’ type redefinition  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\GameFramework/GameModeBase.h(20): note: see declaration of ‘FLogCategoryLogGameMode’  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(69): error C2027: use of undefined type ‘FLogCategoryLogGameMode’  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\GameFramework/GameModeBase.h(20): note: see declaration of ‘FLogCategoryLogGameMode’  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(69): error C2065: ‘CompileTimeVerbosity’: undeclared identifier  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(69): error C2228: left of ‘.IsSuppressed’ must have class/struct/union  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(69): error C2228: left of ‘.GetCategoryName’ must have class/struct/union  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(69): error C2665: ‘FMsg::Logf\_Internal’: none of the 2 overloads could convert all the argument types  
> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Core\Public\Logging\LogMacros.h(37): note: could be ‘void FMsg::Logf\_Internal(const ANSICHAR \*,int32,const FName &,ELogVerbosity::Type,const TCHAR \*,T1)’  
> with
> 
> T1=FVector \*  
> ]  
> C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Source\SurvivalGame\Private\World\SCoopGameMode.cpp(69): note: while trying to match the argument list ‘(const char [111], int, ELogVerbosity::Type, const wchar\_t [37], const TCHAR \*, FVector \*)’  
> ERROR: UBT ERROR: Failed to produce item: C:\Users\Kavan\Documents\Unreal Projects\SurvivalGame 4.14\Binaries\Win64\UE4Editor-SurvivalGame.dll  
> Total build time: 47.08 seconds

That’s what happens on 4.14? Can someone help me get this right? I know C++ but kinda new to the engine. I assume it has got something to do with not using getters to access private members?

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [November 30, 2016, 11:21pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/307 "2016-11-30T23:21:40Z")

</div>

Hey guys, the project just got upgraded to 4.14 for those who were having issues compiling.

---

<div class="post-metadata">

**Author:** ![0bas0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0bas0](https://forums.unrealengine.com/u/0bas0)\
**Post date:** [December 1, 2016, 12:16pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/308 "2016-12-01T12:16:54Z")

</div>

Thanks , you sir are a hero 😃

---

<div class="post-metadata">

**Author:** ![acxsasx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@acxsasx](https://forums.unrealengine.com/u/acxsasx)\
**Post date:** [January 12, 2017, 9:25pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/309 "2017-01-12T21:25:22Z")

</div>

I am trying to learn an optimal way to update the UMG from my C++ project.

I see that this project uses Event Tick in Widget\_PlayerInfo to call the functions to update the health bar and energy bar which get the needed numbers from the SCharacter.

I followed another example where I bound the Progress Bar to a function that does the same as the function in the Survival demo (get the data from the character). I have read comments that binding is not ideal for performance. (Don’t know the difference as of yet).

I found this post by @, [https://forums.unrealengine.com/showthread.php?119268-How-I-Mix-UMG-and-C&highlight=how%20i%20mix%20umg](https://forums.unrealengine.com/showthread.php?119268-How-I-Mix-UMG-and-C&highlight=how%20i%20mix%20umg), that I have yet to unravel.

Can anyone point me to resources that will help shed more light on this?

Not a C++ but at least more helpful. .unrealengine.com/latest/INT/Engine/UMG/HowTo/EventBasedUI/index.html

Ok, I used the information in the link to only update the UMG when an event fires. Sometime make this harder than it really is.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_59012487](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_59012487](https://forums.unrealengine.com/u/anonymous_user_59012487)\
**Post date:** [January 14, 2017, 9:35pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/310 "2017-01-14T21:35:04Z")

</div>

Inside of [https://github.com//EpicSurvivalGameSeries/blob//SurvivalGame/Source/SurvivalGame/Private/Player/SCharacter.cpp](https://github.com//EpicSurvivalGameSeries/blob//SurvivalGame/Source/SurvivalGame/Private/Player/SCharacter.cpp)

I can’t figure out where Line #201 is getting “Controller” from.  
Can anyone point me in the right direction.

---

<div class="post-metadata">

**Author:** ![Tiskan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tiskan](https://forums.unrealengine.com/u/Tiskan)\
**Post date:** [January 14, 2017, 10:36pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/311 "2017-01-14T22:36:29Z")

</div>

From the APawn class. SCharacter-\>SBaseCharacter-\>ACharacter-\>APawn. 🙂 Inheritance, sometimes hard to follow. 🙂

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [January 15, 2017, 5:49pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/312 "2017-01-15T17:49:39Z")

</div>

> [@maxproz;651173](#):
>
> Inside of [https://github.com//EpicSurvivalGameSeries/blob//SurvivalGame/Source/SurvivalGame/Private/Player/SCharacter.cpp](https://github.com//EpicSurvivalGameSeries/blob//SurvivalGame/Source/SurvivalGame/Private/Player/SCharacter.cpp)
> 
> I can’t figure out where Line #201 is getting “Controller” from.  
> Can anyone point me in the right direction.

Inherited from APawn 🙂  
.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/APawn/index.html

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_802caa18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_802caa18](https://forums.unrealengine.com/u/anonymous_user_802caa18)\
**Post date:** [March 14, 2017, 11:40am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/313 "2017-03-14T11:40:48Z")

</div>

How can I modify the rifle’s impact effect so its decal looks like a hole rather than a line?

[Previous page](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878.md?page=14)

[Next page](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878.md?page=16)
