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++?
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)
answered Jun 12 '18 at 08:12 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here