All going great until it came to the enemy ship, i want it to patrol. Ive created an array of waypoints that ive placed in the level and have made this function to pick a waypoint at random, rotate to face it and then move to it. The enemy ship is rotating to look at the waypoints no issue but doesnt move to the waypoints. It kind of goes towards them jumping in increments and i cant figure out why. The ship is moveable as are all components linked to it. I have added a floating pawn movement component too.
Also both of these GetActorLocation functions will output different locations. Since the Random Integer in Range is a pure function, it will get executed every time something it’s connected to is executed. in this case you’re using Get 2 times, so it’ll get 2 different elements from the array.
You’ll have to cache the random element in a variable before using it avoid the above issue.
Excellent. I wasn’t sure if I’d need to store the index it picked in order to make sure the location and rotation related to the same way point. I have tried calling it on begin play and on tick to see if it changed anything. Thanks for the info regarding the array. I’m fairly new to blueprints, I understand how to do things using code but I’d rather use blueprints as its more interactive I find and more of a challenge