![]() These are all the variables that we will need to create the enemy AI logic. When the AI MoveTo function finishes, we are going to delay for 1 second using the Delay function, and then call the Random Patrol node we create so that the enemy will randomly patrol the level again.īefore we proceed to test this out, from the BeingPlay call the Random Patrol node we created: ![]() Of course, we can change the radius value to a higher or a lower number anytime we want to make the enemy patrol further in the level. ![]() This function will calculate all the collisions that are in the way of the AI and that way the enemy will cleverly avoid any obstacles in his path.įor the origin parameter of the GetRandomReachablePointInRadius function we provided the location of the enemy, because we are going to patrol from the enemy’s location.įor the radius I’ve set 1500 as the value, which means it will try to get a reachable point from the enemy’s location in the 1500 value radius. For AI MoveTo parameters we provided self, which is a reference to the enemy blueprint, and for the destination we used the GetRandomReachablePointInRadius which is a function that will give us a reachable point in the radius we provide from the origin.
0 Comments
Leave a Reply. |