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"

Is it possible to do "volumetric" ray casting?

Hello, In my game, I have ray casting set up using the single channel trace. I'll be using this for casting actual rays as spells. Since rays obviously have no volume, this is pinpoint accurate for hitting enemies. While this technically works, being pinpoint accurate is not as user friendly as I would like. I'm looking for a way to do the equivalent of ray casting, but as an elongated box to give the player a little more leeway with aiming and hitting enemies (like a really fat ray). If I simply had a box for collision jutting out from the player, that would either block everything it hit (definitely not desirable) or I could overlap, but collision checks wouldn't go "out" in a direction like a ray cast does and wouldn't stop when it first hits something. Does anyone know of a way I could go about getting the effect I'm looking for? Thank you.

P.S. I write everything in C++ and I don't use blueprints.

Product Version: UE older version
more ▼

asked Oct 26 '16 at 02:29 AM in C++ Programming

avatar image

54 6 20 20

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

2 answers: sort voted first

Yes, this is possible. It is called a Sphere trace. I have never done it in Blueprints myself, but Rama has a very good answer that you can use: https://answers.unrealengine.com/questions/130430/how-to-make-a-sphere-trace.html

more ▼

answered Oct 26 '16 at 02:40 AM

avatar image

2.7k 108 36 180

avatar image sseufert Oct 27 '16 at 01:51 AM

Ah, this looks promising. Thank you very much!

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

You could also do 4 (or any number) of ray casts that are close to each other in parallel. If any one of them hit the target, count it as a hit. In this way, if the target is partially behind something and hence blocked by one ray cast, they can still be hit by the others - you would not get this in a sphere ray cast.

more ▼

answered Oct 27 '16 at 07:17 AM

avatar image

58 1 9

avatar image sseufert Oct 30 '16 at 07:46 PM

The sphere trace ended up working out really well for me. For this game, I don't think I'll need the type of accuracy described in your method, but I'll keep the idea in mind for future projects. :)

(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