Choose actor to (or not to) trigger overlap events


I’ve been trying to set up different spawn methods for pawns, one of them being ‘Spawn by Proximity’. So i added a sphere collision, but when i start the game, the sphere is instantly triggered (twice)! I think they were triggered by the floor and the wall, but when i place the sphere midair and jump into it, it’s not triggered for some reason…

Can I specify, that the sphere can only be triggered by the player and why could the player not trigger this?

Have you tried changing the Collision Preset? You can set it to custom and then tell it to overlap Pawn and ignore the rest.

The Sphere now reacts to the player, but its still triggered twice at game start.

This is how I set up the sphere and its collision:

And this gets triggered twice:

I’m still assuming its the wall and the floor, but it should ignore these?

First of all connect a print string to “Other Actor” pin converted with “Get display name” to discover what is overlapping, for more precision do it even with the component pin. If is overlapping itself (and is possible) just add a branch node connected with a “Other Actor” != Self condition. IF you want the event triggered only by a specific class just put a cast node as first node after the event.

Quick example:

For some reason, it printed nothing (!) when i connected the print string to other actor and other comp. However, after implementing the self condition, it was clear, that it was triggered by itself, as you said.

But now it doesnt react to the player character anymore… As you can see from my previous answer i customized the collision for the sphere, but i still cant trigger it by walking through it.

For test purposes, I placed the sphere midair again, resulting in no overlap event (with itself???) at game start. Still not triggerable by walking/jumping into it.

Uhm, the event don’t trigger even when a pawn overlap the sphere? Put an eye on character’s object type because this is very weird. Also check for the value of variables in your bp “Spawn by Sphere” and “Radius”. Easily you can draw a debug sphere to better check.

Unfortunately I haven’t been able to resolve the problem, I’m trying to solve this with a different approach:

I’ve set up a custom sphere trigger which is supposed to get spawned at the desired location with radius and all set up AND with a reference to the actor, which it is going to spawn when overlapping. However, that reference is always not valid, can you think of a cause for this?

I have no idea why isn’t valid, same for the Spawned by pin. Yesterday I’ve done the delivery of the promo of my game so now I’m a little more free. Tell me exactly what the BP is suppose to do and I can try to replicate it.

Sure, this is inside my enemy blueprint. its checking, if this enemy should spawn from the player being nearby (with nearby being the sphere radius). If yes, i want a sphere trigger to spawn at the enemys location, with a reference to the enemy that spawned it, since when the sphere is triggered, it needs to ‘spawn’ the correct actor. Spawning enemies in this case means only toggling visibility, active state and collision. The spawned by variable exists in the custom trigger sphere and is set to be StandardEnemy type (which this blueprint is), so it should work. However, its always not valid…

So, let’s me see if I’ve understood well. You want your enemy to spawn when your character step in a sphere collision component? If I’m right IMHO you can do it with a single bp without spawning anything. Do you need to place enemies dynamically from code or manually from PIE? Tell me if I’m right so I can make you a sample project with the bp.

I place the enemies in the editor and adjust their spawn behaviour in it as well. As you said, it should be not necessary to spawn anything, a sphere collision added to the enemies should be enough…

Ok, look at this project. Open the map because I’ve forgot to set the default map in the setting.

link text

Yes, but not quite. The main problem with your example is, that the spheres center should be the spawning enemy.

That way i can do stuff like: ‘If this the player comes closer than 300 units, spawn that enemy.’

Well, keep the vector = 0,0,0, enlarge the radius and the bp should work.

EDIT: Works like a charm, thanks a lot!!!