Download

Is Overlapping Actor issues

Hello everyone,

This is my situation :

Let’s assume that i have two “Ground_Blueprint”, one ground with grass, the other without grass on it.
I want to make the ground without grass able to detect the presence of a ground with grass near him and then if so, to change his mesh and his material for different ones :

On the screen “On component Begin Overlap (box)” is the ground without grass (with a collision box in it), and “Cast To Grass_brase_bp” is the ground with grass

Now, my problem is that “Is Overlapping Actor” is always returning false, another problem also, cast to “Cast To Grass_brase_bp” always fail.

I don’t understand what is the problem :s
Can someone please help ?

Thank you all !

If you just want to check if the “Ground with Grass” actor is overlapping with the “Ground without Grass” actor, the cast operation you already have is enough. If it succeeds, then it means that they are overlapping. So you don’t need to check again with the “Is Overlapping Actor”.

As for the cast failing, that’s most likely due to the collision settings for the boxes on both actors not set to overlap with each other. It would be easier to debug if you can share their (collision boxes) collision settings.

Ah ok thank you for all this informations ! I’m at work actually, i will send all this tonight. :slight_smile:

Thanks a lot @Stormrage256, it seems that my real problem now is the “On Component Begin overlap”, because when i start the game some component will be already overlaped…so this don’t work. And when i moove the component during the game the cast work !

So i have to find a good way to make it work :s
Maybe you have an idea ? I’m actually trying to find out and will answer here is i found something fine.

Alright, so I tried it out in one of my projects and I believe you’re right about the overlapped at start part. So what you can do is use the Get Overlapping Actors node in “Event Begin Play” & set the “Class Filter” for it to the “Ground without Grass” type. You can then For Loop through the overlapping actors array & execute your logic. As for the actors that are not overlapping right from the start, your begin overlap should handle it like it normally does.

However, even this approach runs into the same issue of the collision component not being fully activated at the Begin Play event since it’s not returning any overlapping actors. So while I’m not a fan of adding delays at start (due to not knowing how long something needs to activate), adding a single frame delay of 0.0 seconds seem to be enough for the collision component to start doing its job.

Thank you a lot @Stormrage256 for your precious help !
I’ll try this as soon as i can and will give feedback here for this. :slight_smile:

Many things change in this part of my project, so i’m going to apply this logic, but not like i was expecting ! So i will need more time to think to how to fix my problem.

Thank you again !