Splinemesh Overlap Event won't trigger?

Hello, I can’t figure out how to get any overlap events working with my spline mesh. No matter what I do, my character passes through the spline (which is fine), but does not trigger any events.

Construction script (allows multiple meshes to be created for a longer spline)

Blueprint + Event Graph

Character standing in the spline

Anyone know why this could be happening?
Thanks!

Hello Juice-Tin,

Could you try setting the collision for the mesh that you are creating to “Overlap all”? I hope that this helps.

Make it a great day

The spline was set to overlap all, but adding it to the ‘Add mech component’ node made it work. Thankyou. :slight_smile:

I’m having the same problem and the first search engine result is this thread. Can you please attach a screenshot of the changed blueprint or asset to show how you fixed this issue?

For those still looking for this (and for me in a few months when I’ll forget again), you might have to call “Update Mesh” from the static mesh component after changing it’s positions, tangents, scale, etc.

At least, in this instance, that did it for me.

look the same problem in 2024
cant overlap any of splinemeshes. Watched all tutors about this. nothing helped(
Any suggestions

  • ensure the spline mesh has collision:

  • or use complex collision:

  • add spline meshes:

  • ensure the collision channels are set up if you have not done so for the mesh defaults:

  • and on the other end as well:

1 Like

I get hits for pawns but no other objects. I’ve been playing about for a few hours flicking collision settings on an off for objects around the level but only pawns trigger overlap events, and even then it’s only capsules belonging to characters; even if I set a collision shape of another object to pawn, nothing triggers. Something is very fishy with these spline mesh comps…

1 Like
  • are the objects set to generate overlap events?
  • how do the objects’ collision settings look like?
  • how are you debugging it?

Sorry just updated original post with more info. When you get sec, can you try to replicate the issue and see if you can get correct behaviour for world dynamic objects? Just to make sure I’m not going mad.

1 Like

I’m in cpp but here’s the spline mesh comp:

	if (USplineMeshComponent* NewMesh = NewObject<USplineMeshComponent>(this, USplineMeshComponent::StaticClass()))
	{
		NewMesh->SetMobility(EComponentMobility::Movable);
		NewMesh->RegisterComponent();
		AddInstanceComponent(NewMesh);
		NewMesh->SetStaticMesh(PathMesh);
		NewMesh->SetGenerateOverlapEvents(true);
		NewMesh->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
		NewMesh->SetCollisionObjectType(ECC_WorldDynamic);
		NewMesh->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
		NewMesh->SetCollisionResponseToChannel(ECC_WorldDynamic, ECollisionResponse::ECR_Overlap);
		NewMesh->AttachToComponent(PathSpline, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
		NewMesh->SetStartScale(FVector2D(PathWidth * .01, 1.f));
		NewMesh->SetEndScale(FVector2D(PathWidth * .01, 1.f));
		NewMesh->SetMaterial(0, DynamicPathMat);
		URuntimeVirtualTexture* RVT = Cast<URuntimeVirtualTexture>(StaticLoadObject(URuntimeVirtualTexture::StaticClass(), nullptr, TEXT("/Game/Packs/DreamscapeSeries/SharedResources/Materials/Terrain/RVT_Landscape.RVT_Landscape")));
		NewMesh->RuntimeVirtualTextures.Add(RVT);
		PathMeshes.Add(NewMesh);
	}

and a collision box on another actor:

	CollisionBox = CreateDefaultSubobject<UBoxComponent>(TEXT("Collision Box"));
	CollisionBox->SetupAttachment(RootComp);
	CollisionBox->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
	CollisionBox->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
	CollisionBox->SetCollisionResponseToChannel(ECC_WorldStatic, ECollisionResponse::ECR_Block);
	CollisionBox->SetCollisionResponseToChannel(ECC_WorldDynamic, ECollisionResponse::ECR_Overlap);
	CollisionBox->SetCollisionResponseToChannel(ECC_GameTraceChannel2, ECollisionResponse::ECR_Block);
	// paths
	CollisionBox->SetCollisionResponseToChannel(ECC_GameTraceChannel11, ECollisionResponse::ECR_Overlap);
	CollisionBox->SetCollisionResponseToChannel(ECC_Visibility, ECollisionResponse::ECR_Block);

Confirmed nothing funky going on at runtime:


I can confirm this works for non pawns, too. There should :crossed_fingers: be no issue here. I added a spline mesh actor to the level:

And dropped a cube on it:

Blocking also works. That’s as of UE v5.5.4


@elguapador Visualise collision - perhaps it does not deform properly.

I don’t see any read-outs of the overlap working (although I’m sure you tested it).

Tracked down someone else with this issue on Reddit and confirmed the workaround:

“After having more problems with Spline Mesh Component collisions I’ve tracked it down to what seems to be a bug where the collisions break if you use the set start/end etc. and update mesh to change the mesh position without moving the actor.”

https://www.reddit.com/r/unrealengine/comments/5tux85/whats_up_with_splinemeshcomponent_overlap/

Confirmed that as soon as I moved the actor at runtime, the meshes updated and triggered overlap events.

I’m on 5.3 so may have been fixed in 5.4 and beyond…

Good info!

eyeball it with ShowFlag.Collision 1

That was my first port of call. Visually the coillisions look fine, and (just tested) there’s no difference visually when moving the spline parent actor.
Before:


After:

(the red is an in-game shader param change)

Here’s my workaround for now if anyone is adjusting splines and their meshes at runtime:

In begin play or wherever you start adjusting the spline:

	// force collision check due to engine bug
	FTimerDelegate Del;
	Del.BindLambda([this]()
		{
			AddActorWorldOffset(FVector(0.f, FMath::FRandRange(-.01, .01), 0.f));
		});
	GetWorld()->GetTimerManager().SetTimer(ForceCollisionTimer, Del, 1.f, true);

(In blueprints, call a looping timer, save the handle and clear and invalidate when you’re done).
Which will force an update every second. Then just make sure to clear the timer when you’re done generating or deforming your spline meshes.

You could actually be more precise to ensure the actor is never more than .01uu away from it’s original position but I cannae be bothered.

Confirmed it fixed the issue for me.

Note that if your splines are large and/or mesh geometry complex and/or you are looking to run this logic for your whole game loop, this will hurt performance. Luckily for me, I only need collision while placing my spline then I’m done.

1 Like