Community Tutorial: Hide and Seek C++ Tutorial Series: Part I

Within this tutorial series, we will be creating a blank C++ project based on the always classic game hide and seek. We’ll start off small, creating a first-person character whose input functionality is managed by a player controller utilizing the enhanced input system. By the end of our time together, however, we will have a diverse array of classes communicating between one another as the player attempts to make their way through a level and find all the hiding spots of their opponent. We will see how using delegates and interfaces, we can facilitate this communication to trigger a range of unique functionality, exclusively in C++. In addition, we’ll be doing things like building a user interface that includes dynamic progress bars, querying different object types to determine actor behavior, animating actors through the use of timelines, and much more. We’ll even be doing some cool things in the editor, like using modeling mode to build an awesome world and create our own meshes!

https://dev.epicgames.com/community/learning/tutorials/bXy3/unreal-engine-hide-and-seek-c-tutorial-series-part-i

4 Likes

Very good tutorial.
Few typos in code.
This one drove me crazy for few days :slight_smile:
in “CPP_PlayerController.cpp”
include “EnhancedInputSubsytems.h”
is misspelt
should be
include “EnhancedInputSubsystems.h”
Kept getting “cannot open source file”.

Sorry about that! I really appreciate you pointing it out!! If you remember where any of the other typos are, please let me know!

few more minor typos

Player Character: Sprint II

line 31 uses StaminaDrainRate instead of StaminaDrainFrequency

Player Character: - StopSprinting

line 26 uses StaminaRechargeRate instead of StaminaRechargeFrequency

Player Character: DrainStamina, RechargeStamina

line 20 uses Stamina instead of CurrentStamina

2 Likes

Thanks! I tweaked the code one too many times while working on the tutorial, changing variable names around and even the project name itself at one point. Definitely learned that was not the wisest choice! I really appreciate you letting me know about these issues though!

Ran into one more issue.
My editor would crash when trying to run the game.
Error message

Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 4512] FObjectFinders can't be used outside of constructors to find Texture2D'/Game/Textures/crosshair_small.crosshair_small'

Under HUD: BeginPlay
I moved the

"ConstructorHelpers::FObjectFinder<UTexture2D>" code (lines 13 to 25) in "CPP_HUD.cpp" 

from

"void ACPP_HUD::BeginPlay()"

to the constructor

"ACPP_HUD::ACPP_HUD()"

Worked fine after that.

Anyway , I finally finished your tutorial. :slight_smile:
It was a big help.
Still few grey areas in my head but I am lot more confident now than I was before I started the tutorial.
So thank you and keep up the good work.

Wow! Thank you, I really appreciate that! What areas are you still unsure about? I might be able to add some clarification.

It was a really detailed tutorial that even a beginner like me was able to follow easily… Thankyou hodking sir for doing such hardwork to teach us… Btw really waiting for the 2nd part. When will it be uploaded? :sneezing_face::sneezing_face:

Hi Kait! Thank you for your kind words, so glad I was able to be of service! As far as part 2 goes, at the moment that’s kind of up in the air. My schedule is a bit more intense than it was during part 1 and I’m still trying to decide exactly what I would like to include in part 2 (and what the best way to present it would be.) I might just tack individual sections on to part 1 as I complete them, which would have the benefit of adding more content quickly. On the other hand, for instructive purposes, it might be better to actually complete the entire second part and post it as its own entity. Anyhow, it shouldn’t take nearly as long to get out as the first part, and I’ll be able to start work on it soon. Again, thank you for letting me know you found it helpful and if you want, I can definitely keep you posted when part two is on the way!

1 Like

Hey there Hod bro. Can i get a date or month by when the tutorial will be uploaded? I was really searching for tutorials for unreal with c++ and yours is by far the best i can learn from as its really detailed! I really wanna learn soon how to implement the game logic as how to seek and hide fucntions… Please reply as soon as its possible :cry:

Hey Maker, very glad I was able to help out! I don’t have a solid timeframe yet for when the second tutorial will be published, but if all goes well, I’d hope to have it ready before the year’s out. I really appreciate your feedback and it’s definitely motivation to release the second tutorial asap. If you want, I can send you a message when I have a better idea of when it will be published!

Hi everyone, just finished with Part II for those of you who are interested (you can find a link to it at the bottom of the first tutorial). Sorry it took a while, but I hope you find it useful. If you do work through it, let me know what you think!

Hello Maker, just wanted to let you know that I just published Part II, if you’re still interested! You can find the link at the bottom of the first tutorial :slightly_smiling_face: