Spawn bot with player state? - 4.17
I am trying to create a FPS game with bots (similar to shooter game example). I want the bots to behave just like other players, so I want them to have a player state to keep scores, names, team, etc.
I have not found a way to do this in blueprints. I stumbled upon a post showing how to do this in C++ (https://answers.unrealengine.com/questions/62160/blueprint-do-aicontrollers-characters-have-players.html), but it was for version 4.4 (I think). I know almost nothing about C++, so I do not know how to do it in version 4.17, which is what I am using.
Does anyone know what the updated code would look like? Thanks.
asked Nov 04 '17 at 08:51 PM in Blueprint Scripting
Figured this one out on my own. For anyone else with this question, here is what I did (again, this is Unreal Engine 4.17):
I created a C++ class. I named it BotAIController. It's parent class is AIController.
In the .cpp file:
In the .h file:
Remember, if you name your project or controller something different, you will have to make some minor changes to the code.
That's it! It was much more simple than the code for 4.4, which, for anyone interested, looked something like this:
answered Nov 05 '17 at 03:31 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here