Event to check if AI is colliding with Player

Goodday!

I’m looking for a event to check if the player is colliding with a AI.

You should use a volume which is colliding with another one, with the function OnComponentBeginOverlap.

1 Like

I tried that but the values coming out of the Overlap are weirdly mixed. I had a OnBeginOverlap with a “set in overlap? to true” and a OnEndOverlap with a false value. I used a string to see what value it’s set to and it returned as false, false, true, false etc. Even though I was the whole time in the overlap.

If overlap is not working as expected I would run some timer and do a capsule trace and see if it hits an AI, another way if you have the list/array of AI available you can check by distance from the player and determine you’re colliding with the AI that way.

1 Like

Hey @Doeglas! As Kai was saying, one other way would be to do a capsule trace in the area and it would go a little something like this. (ignore the names of things). You can even use the cast to send info/commands to the AI that makes contact.


2022-08-09_00-57-42

2 Likes

I’ve changed it so it would look from the Character if the AI is overlapping and then using a custom event to activate stuff in the AI BP.

Thanks for responding tho

1 Like