Performance Issue using Overlap Sphere Components on AI Characters

In my multiplayer game, I have added 2 sphere components to an AI character; one that detects when a player enters it, and a larger one that detects when a player exits it. I have about 20 of these AI’s spawned in the level. However, I notice that the performance of the game gets very bad when I have these sphere components. If I remove them, the performance is much better. Here are the collision properties that I set for each sphere component:

  • Collision Enabled: Query only
  • Object Type: World Dynamic
  • Collision responses to all objects and traces are set to ignore (expect the Pawn object, which is set to Overlap)

What is causing the performance degradation from the sphere components? Could it be because sphere components with overlapping events are calling a tick function under the hood to detect overlaps?

Yes.

Thanks. If I remove collision, will it still trigger the tick?

If Generate Overlap Events is set to true, it will check for overlap every tick.

You mean the node Tick?

If yes, Tick node isn’t the tick, it’s an event that is called every tick.

So if I set “Generate Overlap Events” to false, this should disable the tick function and improve the performance?

No, it will just stop checking for overlaps and improves the performance.

If you need to check the distance between AI and the player, use Distance node.

You mean this:

image

Yes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.