UC only a strange bot, this is a very simple strange, it will not run, will only rotate and shooting in situ, so there is no behavior tree or the like, so here around the bot strange how to find players, attacking players, the player attack analysis bot
1 when the game starts
Can be seen in the editor when the bot is not armed, is at the beginning of the game is the weapon brush out, put on the hands of the
2. Discover the Player
When the game starts, the bot starts a 0.5-second timer, executes Checkforplayer to sweep the player,
Checkforplayer implementation is simple, is to calculate the head of the bot and the player's Camero distance, if less than a value, it is considered to be found players, and then calculate the amount of rotation of the bot monster, why to calculate this rotation amount, because the bot strange vision, That is, the angle between the player and the bot is not less than 31 degrees, otherwise the bot will ignore the player
3 attacking players
Attacking the player is the most interesting part of bot AI, the overall logic, the bot Strange Update (Tick) event, will always check whether the player was found, if it is a true adjustment of their direction, so that their angle with the player is greater than 31 degrees, and then set a very important variable haslos, This variable will change the bot monster animation in the BP state machine from Idel to shoot, then play shoot animation, shoot animation will have a notify, notify Bot monster shot
The Notify in shotting animation
When playing to spawnprojectile this frame, will trigger the bot monster shot
And then we call the weapon shot.
3Bot Monster by Knife
When the bot is struck by a knife, HitPoints-2, brushes a blood-stained effect in the hit position, and gives it a momentum, then the blame dies,
4. Hit by a bullet
-----------Reprint please indicate the source
Bot Monster AI