Hi friends ,
We have been developing a multiplayer game ,
now we came a cross an issue after adding bot to our game which is saving Bots data (data or info that needed by other players like number of kills , deaths and more)
Now as you may know UE AAIController does not have a AplayerState built-in with it .
so my question is How can we transfer data from Bots to all other players ?
or is there anyway to add APlayerState to AAIController
or can we use AController to control bots ?
Yes you can simply set bWantsPlayerState = true in your AI controller class and it will spawn its own default playerstate just like regular players.
Be aware though that when bot controllers have a playerstate, they don’t destroy themselves automatically when their pawn dies. You might want to alter your gamemode logic to handle respawning bots (just like players) rather than recreating them. If they do not need to respawn, you might want to destroy the controller when they die.