How to get overlapping component of the overlapped actor

This is probably something trivial but in an actor BP, I can’t figure out how to get an array of overlapping components of the actor itself (and not the other actor). Even if I use Get Overlapping Components with self as target, the engine still provides the components of the other actor.

For example, this prints out the components of the other actor:

Of course I could do the same thing in the other actor’s BP and get the data from there but that can’t be right.

Thank you in advance!

1 Like

I guess you have to

I think it’s assumed, that if you want to know if something local is being overlapped, then you’ll use an event for that.

Thanks for the reply!

I just have many components (maybe that’s a bad idea altogether) and having an event for each doesn’t seem very flexible.

I tried to use Get Components By Class with loop just like you showed, but it doesn’t look like I can connect anything compatible to the Array Element pin that would give me information regarding overlapping, e.g. trying to connect Is Overlapping Component results in a message that complains about reference type mismatch.

Thanks for the reply!

I just have many components (maybe that’s a bad idea altogether) and having an event for each doesn’t seem very flexible.

I tried to use Get Components By Class with loop just like you showed, but it doesn’t look like I can connect anything compatible to the Array Element pin that would give me information regarding overlapping, e.g. trying to connect Is Overlapping Component results in a message that complains about reference type mismatch.

Are you trying to find what’s overlapping with meshes, or collision volumes?

Collision boxes (→ volumes?)

EDIT: to be more specific, the BP I am working on has collision boxes and if a certain other BP with mesh components overlaps it, I want to know which collision box was triggered.

This will give you a list of the components in the other actor that are overlapping your collision volumes

But we’re back to square one then. Because that’s what you had in the first place.

How many volumes do you have!? I think my max is like 2.

What is happening, what are you trying to do?

That’s this

image

But the best way to find which one is overlapped, and act on it, would be an event :slight_smile:

Because the way you react to each volume may be different, it makes sense to have different events.

If you just want to react to any sort of overall overlap, then use

image

I have a racing track with randomized obstacles. If the player dies on the track, the car will be respawn in the beginning of the track. The idea is that the BP that generates the track has collision boxes along the track. If the player reaches a box associated with a certain obstacle, the obstacle is switched so that the player has a new set of obstacles to deal with.

Ok, those obstacles need to be separate blueprints, then. That would be easiest.

You can spawn them along the track, and each obstacle can react in its own way.

It sounds a bit like you’re trying to manage it all from a central point, which will bring pain… :slight_smile:

I tired both. What is happening? I feel like a crazy person. :sweat_smile:

The obstacles are separate BPs but at least the way this is set up now, the track creator BP tells these BPs which static meshes they should use.

Self is not a box collision component :slight_smile:

So, when the car collides with an obstacle, the obstacle can make itself into something else while the car goes back to the start.

I’m not sure I understand where you’re getting the idea you need to investigate multiple components from… :slight_smile:

At this point I only needed to know if one of the components is overlapped but I just thought that getting array might also be helpful in future in case I have something complicated going on.

…I still don’t get why I can’t (and you can) connect the Get Overlapping Components. I thought this will loop through all of the components of a certain class in a certain actor, and then I would e.g. check for each whether they are currently overlapping. What exactly should I do in order to get the overlapping information like you did?

I really should take another BP course…

I got it working! Didn’t do anything differently, it just connected and now it works with both Get Overlapping Components and Is Overlapping Actor. UE acted weirdly for a while, but it did agree to compile in the end and now everything works. I think it was a bug. I am not crazy.

So many thanks ClockworkOcean!! :hearts: :milk_glass: :milk_glass:

You can’t repurpose old nodes. You need to make new ones by dragging from what’s there, in this case the loop.

One of the nodes had been placed in the graph, the other was made by dragging.

The first, was relating to the Self ( the blueprint ), and so could not be connected to a list of components. The second was made by dragging from the loop, and so was referring to a component.

You wanted to know :wink:

1 Like

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