How to check if a point is inside a collider?

Hi, I posted this before in the unreal forums, but they redirected me here for more help. This was my post:

Hi, I want to spawn an actor in a random position in the navmesh. I generate a random point, but I want that the point generated is outside certain colliders. In the spawn actor function theres a boolean ‘Spawn even if colliding’, but its not working. Also, I don’t know how get if the actor has not been created. So, my idea now is to get the point generated, check if it is inside those colliders, then: A. If it is inside, generate another point. B. If it is not inside, create the actor there. But I don’t know how to check if a point is inside a collider component.

Thanks in advance.

This worked for me when I tested it. Make sure that your collision component has BlockAllDynamic set in the collision properties to prevent spawning. The character can still run through them (at least in my test it could), but objects won’t be spawned at those locations.

Your other question, you can check whether an actor was spawned by using the Is Valid node on the return value. If that returns true the actor was successfully spawned.

First, thanks for replaying.

Second, I have some problems with your answer:

  • Now objects don’t spawn inside collider. But I want just 1 object can’t spawn there, the others can.

  • I have the ECB in Yes but I can’t enter the collider, also other enemies can’t.

Edit: the enemy is still spawning inside the collider D: