# Performance Issue using Overlap Sphere Components on AI Characters

**URL:** <https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586>\
**Category:** Programming & Scripting\
**Tags:** ai-navigation, sphere-collision, overlap-actors, unreal-engine, question\
**Created:** [September 25, 2023, 2:55pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586 "2023-09-25T14:55:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [September 25, 2023, 2:55pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/1 "2023-09-25T14:55:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Shunitzo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shunitzo/32/1194547_2.png) [@Shunitzo](https://forums.unrealengine.com/u/Shunitzo)\
**Post date:** [September 25, 2023, 2:57pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/2 "2023-09-25T14:57:46Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [September 25, 2023, 4:43pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/3 "2023-09-25T16:43:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shunitzo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shunitzo/32/1194547_2.png) [@Shunitzo](https://forums.unrealengine.com/u/Shunitzo)\
**Post date:** [September 25, 2023, 4:48pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/4 "2023-09-25T16:48:33Z")

</div>

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

> [@ackyshacky](#):
>
> will it still trigger the tick

You mean the node Tick?

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

---

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [September 25, 2023, 4:52pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/5 "2023-09-25T16:52:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shunitzo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shunitzo/32/1194547_2.png) [@Shunitzo](https://forums.unrealengine.com/u/Shunitzo)\
**Post date:** [September 25, 2023, 4:54pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/6 "2023-09-25T16:54:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shunitzo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shunitzo/32/1194547_2.png) [@Shunitzo](https://forums.unrealengine.com/u/Shunitzo)\
**Post date:** [September 25, 2023, 4:57pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/7 "2023-09-25T16:57:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [September 25, 2023, 4:59pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/8 "2023-09-25T16:59:42Z")

</div>

You mean this:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/c/3ec113ef25d4c8436d2a89840361c240986569f4.png)

---

<div class="post-metadata">

**Author:** ![Shunitzo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shunitzo/32/1194547_2.png) [@Shunitzo](https://forums.unrealengine.com/u/Shunitzo)\
**Post date:** [September 25, 2023, 5:00pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/9 "2023-09-25T17:00:32Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [October 25, 2023, 5:01pm UTC](https://forums.unrealengine.com/t/performance-issue-using-overlap-sphere-components-on-ai-characters/1311586/10 "2023-10-25T17:01:11Z")

</div>

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