I’m relatively new to Unreal. Where would I store game logic for a singleplayer game?
Hey there @SomeRandomDoggo! Singleplayer leaves you with so many options!
One common location for storing game logic and variables you want to persist your entire game session is the Game Instance. Game instances quite literally persist the entire time you have the game itself open, so it’s usually best for holding game flags or anything that needs to remain persistent through the entire play session, or even accessed outside of the main game loop.
Alternatively, your Game Mode can handle functions related to your game loop, but is destroyed every time you change level, so you’d want to either save variables using a save system whenever feasible (which is good practice for heavily persistence based games anyway).
Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
Here’s a video that shows off some of the methods mentioned:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.