OnComponentBeginOverlap fires only once

hello, i’m working on Flying template, UE 4.8.3, and i’m having kinda weird issue with “OnComponentBeginOverlap”

the “OnComponentBeginOverlap” fires only once (just one time) when the player controlled flyingPawn (the jet) enteres the sphere collider,

59050-oncomponentbeginoverlap.png

this is how the hierarchy looks like

59052-brdm_hierarchy.png

i had to make the blueprint class of type “Pawn” though i could change the “AI Controller Class” in future

besides, the “Collision presets” for “BRDM_Sphere_Collider” is “OverlapAllDynamic”,
and the “Generate Overlap Events” is checked .

so what’s the problem, and how to solve it ?!

thanks.


update :
the intended behavior is as follows :
whenever the jet fighter which is of class type “Flaying Pawn”, enters the sphere collision area(which is a child component of Pawn class type) as shown here

59052-brdm_hierarchy.png

the “OnComponentBeginOverlap” of the sphere collision component, should keep executing while the jet fighter is still inside the sphere collision area (inside the bounds), but what happens is that it executes just one time, exactly when the jet fighter enters the sphere area, and stops executing while the jet is moving inside the sphere bounds


besides, i’m using the same blueprint graph but on a parent class type of “StaticMeshActor” as the next picture shows, and it works perfectly and the “OnComponentBeginOverlap” keeps executing while jet fighter is inside the sphere collision bounds

59305-works_perfectly_on_staticmeshactor.png

so the problem is not the further code attached to “OnComponentBeginOverlap”, but the execution behavior of “OnComponentBeginOverlap” itself.

also i’m sure that the “Collision presets” are configured correctly & the “Generate Overlap Events” flag is checked .
so i guess it is all about the parent class type, and the hierarchy of its child components .

any help or suggestions please ?!

hope it’s not a bug.

thanks .

We need more info, can you post the logic you have tied into OnBeginOverlaap and OnEndOVerlap ? It should fire everytime you enter, exit, and then reenter it.

hello @Nsomnia, iv’e posted some further updates, could you read them please, and if any further specific information needed just let me now please, thanks .

It looks to me like, the OnBeginOverlap is working correctly, it will fire exactly one time, per “contact”.

Two objects A and B, both set to generate overlap events, like you have them set up, or it wouldn’t work at all.

When either A or B, contacts each other, the event will be fired, as soon as A or B, exit the overlap “area”, then the event becomes “re-armed” again, to fire, should A or B contact.

To keep something going on continuously, you need to remember, the overlap event, and then turn off remembering when you get an OverlapEnd event, or that A or B check per tick (or some interval), with a Get AllOverlappngActors node, and the equivalent for Components if you care about that.

Just a thought, have a great day!

The OnBeginOverlap is working correctly, as the name says: it will fire when the overlapping begins. If the two objects stop overlapping the OnEndOverlap event will fire. That’s why i recommend using a boolean variable to store if the objects are still overlapping:

This is my basic setup:

59430-components.png

59431-variables.png

And the blueprint:

Hope this helps you!

thanks, but the thing is that I’ve tried something like that, and didn’t work, but the weird thing is that the same blueprint works perfectly on the other setup, class type “StaticMeshActor” as mentioned before, so i guess it’s about the parent class type, and the hierarchy of its child components .
thanks, appreciate it.

59305-works_perfectly_on_staticmeshactor.png

yeah @Lazarus5000 actually this is what i’m trying to do, and this is how my blueprint works, but the OnComponentBeginOverlap only fires one time, in the other setup for class type “StaticMeshActor” the OnComponentBeginOverlap fires continuously as long as the jet is inside the sphere, and once it gets outside, the OnComponentEndOverlap fires and sets the flag to false, so all of this is not working with the class type “Pawn” cz the OnComponentBeginOverlap is not firing continuously.

thanks .

59305-works_perfectly_on_staticmeshactor.png

The staticmeshactor is probably firing, because, the Jet is moving, or I’m assuming it’s moving. The Box, Sphere, Capsule Collision objects, do work differently, and the “Sphere” in this case, will need to look for what is overlapping it, The Box, Sphere and Capsule, are being derived from the Primitive Component class. That can easily be done on a per tick basis (or use a divisor, if you don’t want it per tick), when the tick fires, just do a Get all overlapping actors, filter it to your needs, and get on with getting on!

Have a great day.

Oh yes, forgot this, a fantastic link to the classes, how often it’s updated, etc, I have no idea! lol

Hi again ammarov,

i am sorry but i am not getting your error reproduced. I set up 2 blueprints (1 pawn, 1 static mesh actor) the same way as you did, each of them has a collision sphere:

59488-pawn+setup.png

59489-mesh+setup.png

This is the setup for the pawn blueprint (the static mesh actor is the same, replacing the “Pawn” with “Mesh” in the message.

59490-blueprint.png

In the next images the instanced right blueprint is the static mesh actor, the left one is the pawn.

Colliding with the collision sphere of the static mesh actor displays the desired text exactly one time, movement while still overlapping does not generate more printed messages… leaving the collision sphere also just prints one text message:

59501-begin+overlap+mesh.png

59502-end+overlap+mesh.png

Exactly the same with the pawn blueprint (with changed messages). I reached my image limit for the post but it is the same, just replace the “Mesh” with “Pawn” in the printed messages.

The collision sphere is working as intended, try to reproduce the ‘bug’ leaving out other components (the destructible) and the logic that you execute after the events to further isolate the problem. If it works as it should something is wrong with one or both of these.

My guess is that your blueprint logic is causing it since the Static Mesh Actor Blueprint has no destructible but is the one that is acting in a weird way.

Anyways, that is all we can do without more details and/or screenshots.

Hey @ammarov,

are you still struggling with the problem or is there anything else we can do to help?

hello, actually no, I’ve found my way out, but i can’t mark any of the answers as correct, so if it’s necessary, i will delete this question.

and sorry for my late reply.
thanks.