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)
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.
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…
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.
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.”
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:
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.