Starkium
(Starkium)
June 3, 2019, 8:19am
10
Gossy:
Hi [USER=“34762”]Manuel Ott[/USER],
We can however do some quick work to improve the performance of your solution. Your “OnPerceptionUpdated” event handler calls the Get Currently Perceived Actors call in a loop. Since it is a Pure function call, that array will be re-created on every single execution pulse of that loop that uses it. Call Get Currently Perceived Actors only once by storing it in a variable / local variable, then referencing that. You can also save a few nodes / execution pulses by combining the 3 Branch nodes into 1 by using a boolean AND of your three conditions.
I’m not sure I follow this entirely. Makes sense storing in a variable and running off that ( which you can obviously add to the array any new unique actors ), but what do you mean by calling it once?