So here i am wondering, how would i go about this problem:
In my FPS game, there are BOTs. BOTs get a random name generated at the start of every game scene. Now what i want to do, is to only generate the name once at the very first start of the level, and then use the same one until i quit to the menu and choose a different map. How would i go about that?
I tried thinking about using static variables, however, these are counted as one and the same across multiple instances of the script. So that’s a no, now making individually 12 or so static variables, and somehow make the script know which one to choose seems like a way too complicated approach to my problem. PlayerPrefs are even worse for this. The last idea i just had was to use some object that uses the DontDestroyOnLoad() function, but then how would i even go about assigning the bot objects when loading a new map again? Please help, i seriously have no idea.
but, you want one name for each typr of bot? you are destroying and instantiating multiple times that bot? i imagine that there ar emultiple type of bots and they get instantiate/destroyed all the time?
– xxmariofer