Moving a Tower Defense Enemy
My tower defense game will , hopefully, involve placing cannons on Islands dotted along the path of a wave of Pirate Ships. The Ships are obviously going to be on a water plane. I have all the static mesh assets and a basic level setup, but I don't know where to begin for moving the ships from their spawn point. How would you go about doing this.
asked Feb 05 '18 at 09:27 PM in Everything Else
it all depends on how you want the movement to take place. is your game based on grids? if it is then you could use an array to store the locations of where you want the enemy to move. for example if you had a 100x100 grid you could set the spawn location to x0y0 then the first target location to x0y300 then another location to x500y300 and so on. you could also do this with an array of target points to make the setup for each level a bit easier. see the picture below on how to set this up.
If your movement isnt grid based and you want things to be more round then you could go with splines. there are alot of tutorials on how to use splines online and i would also suggest looking into the content examples project on the learn tab.
There is the third option of using AI but in this case i dont think its necessary since it would be a waste of resources since there will be many enemies and they are all following the same path. Also in the event you want some enemies to take one path and others to take another it would be easy enough to use a switch or select node to change which path they take.
It's pretty simple you can do it either with use of AI or Just implement auto-movement of actors along spline. I advise you to watch tutorials on how to use AI waypoints or Movement of AI along spline or movement of objects along spline.
Just go to youtube and search on relevant topics, there are plenty of tutorials.
answered Feb 05 '18 at 10:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here