So I am working on an AI plugin, and I need a manager which will calculate covers and flanking possibilities for AIs. I want to do this in a manager to get better performance. I want this manager class to loaded during play, and if possible without placing it as an actor in the level. I don’t want to edit the UE source code, because it’s a plugin. This manager class has to have a beginplay or onlevelload and a tick (I can add that if needed though). What is very important as well, is that everything associated with AI has to have an possibility to comunicate with it, kind of like an actor, but if possible with a ‘getmanagerclass’ function. It also has to have an way to spawn actors in the world. What would be the best class to use?
We put things like this on the GameMode. you can call GetGameMode()->CastToYourGameMode()->GetManager() (and even cache it locally if you’d like). If it needs to persist between levels, then the GameInstance is a better place. (Create a custom one-- you can use GetGameInstance() anywhere in blueprints just like GetgameMode())
In C++ these are in UGameplayStatics::GetGameMode and GetGameInstance
Gamemode seems to suit, however does it have any event that triggers when you start playing? And could I do GetWorld() from it?
Thanks for your response