Hello, I am new to unreal game engine and working on my first game in unreal. It’s a 2d game.
In my game gameplay areas will be defined per level with some sort of method/function to take care of situations when npcs/player go out of bounds.
On some levels, these areas will be as simple as square/rectangle/cricle , etc around the origin and sometimes it can be a custom shape defined by meshes/colliders or something.
I want to make a c++ class/manager that can be picked up by unreal on per level basis that will contain this method MyManager->EnforceMovingObjectWithinBounds() that will take care of any object moving out of gameplay area.
All moving objects will have a custom movement component which can call mymanager->EnforceMovingObjectWithinBounds( newPositionOfObject ) to modify their final position if needed.
I know I can easily hack-N-slash this via a custom actor class but my objective of making this game is also to learn UnrealEngine as much as possible.
Whenever I create a new level of unreal I just want this class to be present by default so even if level designers forget about this there will be this class present in the default state.
So What would be the best way to implement this in Unreal Gameplay framework way of doing things?
A custom GameMode Class?
A custom World class? - I checked documentation but there doesn’t seem to be a way to define a custom world-class per level in the unreal editor?
A custom Level class? - I couldn’t find a way to define a custom level class for any particular level in the editor.