Hi, I feel like I’m being stupid here, or missing something obvious, but I can’t figure out why my On Component Begin Overlap event isn’t triggering at all, I’ve never had a problem with it before, and I’ve watched tutorials to see if I’m doing anything wrong and they’ve all done the same thing; just added the Box Collision and added the event, but for me it isn’t working for some reason.
I’m trying to create water, and add some functionality for when a player overlaps with it, both the player and the Box Collision are generating overlap events, and have the default collision settings applied, but the event isn’t triggering at all, any help would be greatly appreciated, thanks!
Check your collision settings in the project settings.
In my experience in 99% of all such cases the collision types are configured right.
Both object types have to be setup to collide/overlap with the other one.
Collision settings are all fine, the Box Collision is set to World Dynamic and overlaps with everything, and the Character is a Pawn and blocks everything except for Visibility channel, which it ignores, and they both generate overlap events. They are all on the default settings, just like in the tutorials I watched to see where I was going wrong
What do you mean, the Capsule Component inherited from the Character class? If so, then yeah, the only changes I’ve made to the character hierarchy is with the camera and spring arm
I’ve just created a brand new project, created a blueprint with a Box Collision, set the collisions for them (box BP and character) to be exactly the same as my main project, and added the overlap code, and it all works perfectly fine in the new one, so I have no idea what’s causing it not to work in the main project
Oh another thing.
When you add new collision types / object types etc. in the project settings you have to explicitely save and restart the editor/engine, else some changes may not be used correctly.
I haven’t added any new Collision or Object types, I’m literally just using the default settings, and it’s still not working, it only worked in the blank project I created just to check if should work as is, but even with all the same settings in my main project, it’s not doing anything
Yep, I’ve also just right now in the same project made a new Actor BP with a Box Collision, set the physics up the same as the one in my water body, and added the exact same logic on Begin Component Overlap, and again it works perfectly fine
Perhaps you can find the difference by comparing the blueprints with the “diff selected” tool. select both blueprints, right click in them and choose “diff selected”
I’ve just figured out what’s causing the issue, but I have absolutely no idea why it’s causing an issue or how to fix it; OnComponentBeginOverlap does fire, but only if you overlap from the bottom of the box, for some reason it doesn’t trigger when you walk into the collision box from either side or the top
I normally validate the Actor first, make sure that exists. I’m not sure if this is safe, may be… but I’d validate the Actor, and then the component. And then mess around with overlap settings on both actors. But start with simple, manage to validate the Actor first.
Edit: I saw the latest comment now… Again, I’d simplify the example and see if that overlap is problematic in a simpler case. Does it do the same with other overlaps, with other objects? Make a simple box with nothing else… Usually weird things happen when more code and more complex assets are involved.
Just looking at the images, the only significant difference I see is that in one case you have a material applied to your blueprint object, and since it looks like something about water, you might have altered physics behavior by applying a physics material or something.
Just a guess though, but might help.