Hi i would love if someone could help me find Tutorials explaining the following:
-Ai Attacking the player
So For instance:
The player is spawned into level the ai begins to spawn from locations. (Continuously)
But the spawn rate would just become more and faster over time.
Thanks for your time :DD
i dont have any links but ill post a basic script below that shows how this could be done. ok so the first picture shows spawning 1 enemy at a regular interval and it decreases the interval by 10% each time. the second picture is basically the same but i added in a loop so it would spawn a wave of enemies.
now to explain how the script works. on begin play (when the actor is created) the set timer node starts a timer and the timer fires the connected event at the time interval. note that i used a variable to control the time and that the timer is set to looping so it will repeat. now that we have the timer firing the event at a regular interval we can use that to spawn the enemies. the last step is to modify the time interval between the loop firing so that each wave comes sooner and sooner. in this example i just took the time that was used for the last spawn and multiply it by 0.9 (90%) then set the variable so this value will be used for the next spawn. i went with a percentage reduction here so that it is an exponential increase and also to avoid ending up with negative number which could cause issues or need to be clamped. basically by using a percent the longer the player lasts the closer to zero the spawn interval will become but it will never go below zero.
beyond this script you will need to have a basic script in your ai that uses a ai move to with the target set to the player. this will make it move to the players location. from there you just need a way to make it attack the player which depends on your game, do you want actual fighting,for the enemy to explode on impact, etc. if you need more help with the ai let me know. its pretty simple to setup a basic system but like everything can become as involved as you like.