Best way to do a single frame primitive shape collision check?

Easy question! Just wondering what the best way is to do a primitive shape collision check for just a single frame. A good example of this would be, lets say I cast an ability in world space that’s just the shape of a sphere or box. I wanna just do a simple collision check to gather all actors in the sphere/box and return a list of them. This would check to see that their collision component is encroaching within this sphere/box/shape/etc. I know how to do all the struct forming and stuff for the information I want to return, but unsure what FMath/Kismet function would be best for this simple check. It seems like a trace isn’t the answer because that’s meant to travel across space, whereas I’m basically just trying to call a math function that’ll return a list of all actors in a specific shape (just primitives).

As a second question, what is the typical way of implementing a grenade explosion in C++?

Thanks!

I don’t know what will happen under the hood if you feed trace with same start and target locations, but sounds close enough? :slight_smile:

If I were implementing a grenade I would create an actor derived grenade class which uses the UProjectilemovement component. After the safety lever is released, start a timer on the grenade which calls ApplyRadialDamage (or something of like, I’m not at my computer so I can’t check the actual function name. Maybe UGameplayStatics?)

Boom.

Check the various Overlap methods in UWorld.

You can test the overlap of any FCollisionShape you pass in to it, at a given location (FVector) and rotation (FQuat). You’ll likely want one of the more specific OverlapMulti… functions, which will return a TArray of FOverlapResult’s and from here, you can determine what was within the volume of the shape.
(You can also set the various params to specify objects, classes and channels to ignore, thus narrowing down your results)