Changing the ShooterGame Example BotPawn?

Hello everyone!

How are you all?

I was just using the ShooterGame as a base for my own FPS, but ran into a problem when I found that the BotPawn was scripted to attack everyone.

He will attack both the player and other bots.

Is there any way to get him to ignore other bots and only attack the player OR have him ignore the player and only attack other bots?


~ Jason

Most of the logic for the bot finding who to shoot is done within C++. This Service(BotSearchEnemyLOS) calls functions within the ShooterAIController, which is a C++ class, so you would either need to change the logic within ShooterAIController or make your own logic within Blueprints.

I would recommend using AI Perception and EQS for creating your custom bot logic. If you don’t know how to use these, Epic has a great tutorialon how to use them.

This is the Service that finds the bot’s enemy.

You could change it to this so it only picks the player as its enemy. This is far from the optimal way to do this though.

Alternatively you could delete BotSearchEnemyLOS from the BotBehavior tree. Then create a new AI controller that extends from ShooterAIController. Then set the bot’s enemy to the player (like I did in the BotSearchEnemyLOS Service) with the Begin Play event. Once again this isn’t the best way to do this, but it is a quick way to get what you want. Like I said before, I recommend using the AI Perception and EQS to get the Bot to do what you want.

Thanks for the info!

It helped a ton!

~ Jason