Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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++?


Product Version: UE 4.19
more ▼

asked Jun 11 '18 at 01:55 AM in C++ Programming

avatar image

1 1 2

avatar image AyanMiru Jun 11 '18 at 04:34 AM

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

avatar image ZeroParadigm Jun 11 '18 at 10:15 PM

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?)


(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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)

more ▼

answered Jun 12 '18 at 08:12 AM

avatar image

359 2 4 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question