I’m working on a game for mobile, and I made the enemy follow the player (cars) I made the script in a way so a can change the speed of definite enemies types (forward speed and turning speed) that follow the player by using (find look at rotation) and using (Rinterp to) to control the speed of the turning and this been fired by using (set timer by function name) looped at time 0.01 I
but the problem is I have at least 4 enemies at any giving time which means the whole thing been fired 4 time every 0.01, the game rapidly from drop and lags, now my question is how can optimize it?
Check out this documentation Performance and Profiling | Unreal Engine Documentation
This will help you pinpoint where possible bottle necks are coming from.
I’m not so sure you actually need this set up this way.
If you use the AI and just set the movement limits on construction I think it will do what you’re trying to do.
I’ve never messed with a rotation speed though.
I know you can set the movement speed, acceleration, that stuff.
You can create a custom AI controller to do quite a bit.
Then the node AI move to.
Some stuff to trigger it. Like On sense pawn
Or a a way (because police cars or something) to alert the others to also follow.
Basically parent would have the variables for turnning speed, max speed etc.
In the child pull movement onto the construction graph, and from it “set max speed” plug in you floats and have them set per enemy however you need.
You could also put same stuff into a function you call if anything is changed