# How to - AI Character and Player overlap event

**URL:** <https://forums.unrealengine.com/t/how-to-ai-character-and-player-overlap-event/442955>\
**Category:** Blueprint\
**Tags:** overlap-actors, unreal-engine, UE4, Blueprint, question\
**Created:** [February 8, 2019, 5:10am UTC](https://forums.unrealengine.com/t/how-to-ai-character-and-player-overlap-event/442955 "2019-02-08T05:10:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aabun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aabun](https://forums.unrealengine.com/u/aabun)\
**Post date:** [February 8, 2019, 5:10am UTC](https://forums.unrealengine.com/t/how-to-ai-character-and-player-overlap-event/442955/1 "2019-02-08T05:10:50Z")

</div>

Lots of questions. I managed to move AI characters randomly in the field. Now I want to process an event when my player and AI character overlap.

1. It seems logical to use only capsule component for that. Am I right?
2. On Viewport of the blueprint of AI character and my player, should I do anything with collision?
3. I added OnBeginOverlap event in both AI character and Player - but I don’t know what to do with them. (I wish to see how a good script looks like in similar case.)
4. What settings to make in the AI character blueprint and my player (ThirdPersonCharacter) blueprint?
5. Replication. Should I set Replicated ON for capsule and/or for mesh (I have two player game)

Ideally, I want my two meshes attach to each other (or just snap for a while and then detach after a delay. I think, meshes shouldn’t overlap, only capsules!

Anything, guys please let me move on from being stuck here!

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [February 8, 2019, 6:14am UTC](https://forums.unrealengine.com/t/how-to-ai-character-and-player-overlap-event/442955/2 "2019-02-08T06:14:30Z")

</div>

This tutorial should help with the collision part. The other part is use the node “attach to actor” or “attach to component”. You can use “detach from” nodes to remove whatever you attached.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/8/a38eca54c4e031009abedb3fd5c1e17f6229e719.jpeg "Unreal Engine 4 Tutorial: Overlap Events Basic How To") ](https://www.youtube.com/watch?v=oAEs-BTliT4)

---

<div class="post-metadata">

**Author:** ![Crowley\_Caine](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crowley\_Caine](https://forums.unrealengine.com/u/Crowley_Caine)\
**Post date:** [February 8, 2019, 7:08am UTC](https://forums.unrealengine.com/t/how-to-ai-character-and-player-overlap-event/442955/3 "2019-02-08T07:08:51Z")

</div>

1. Depending on how the character looks, either capsule or sphere. Sometimes box.
2. You should consider collision carefully. What does it need to get blocked by, what does it need to overlap. What’s also important is what they detected as, this lets you create your own collision types which can be extremely useful.
3. These nodes are exactly what you want, maybe substitute “On even hit” is necessary sometimes, but you’ll figure that out. I’ll give you two examples. The one on the left is for checking whether a chest has contents and then spawning an emitter once my character gets within a certain range of it, the second one is for doing damage with a weapon capsule (sometimes you may want a DoOnce node here). Notice how I always check if it is overlapping the player character, not something else.

 ![267906-example01.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/7/c/17c2238dc2f347a811dcf587ebbab3b95ebafb42.png)

4 - Not sure what you mean and I think any answer I give might just add confusion.

5 - I know literally nothing about networking so someone else would have to help you out. Here’s some links to read up on if needed:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

> **[Content Examples](https://docs.unrealengine.com/5.1/en-US/content-examples-sample-project-for-unreal-engine/)**
>
> This sample project demonstrates specific concepts and techniques to use in Unreal Engine.
