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"

Line Trace, but check if Capsule is in sight of specific location

Say I have a capsule component for character collision. Now say I have some location in the world that is trying to observe to see if it can spot that capsule (for my case it's a point light for light detection). Basically, how can I check to see if that point in the world can 'see' the capsule? There doesn't seem to be an easy way to detect this with the normal trace functions. Here's a rudimentary example (with a horrible paint drawing) where basically you have a black wall, an orange object slightly peeking out, and a blue point that can barely see it, and I want to figure out how to detect that it can see it.

![alt text

Product Version: UE 4.18
trace.png (8.0 kB)
more ▼

asked Apr 06 '18 at 12:00 AM in Blueprint Scripting

avatar image

122 13 20 30

avatar image ThompsonN13 Apr 06 '18 at 12:29 AM

have you looked into pawn sensing and eqs yet? those may help. otherwise id say to go with a multi line trace but that may not be ideal

avatar image Rael5 Apr 06 '18 at 12:42 AM

I have but those are for ai detection, what i'm doing is just a simple "can a light see the collision box of the character" and it's be weird to have a pawn on a light. Multitrace I don't think would quite work for that either cause I would still need to trace every single point on the collision to see if I only collide with that.

avatar image Nebula Games Inc Apr 06 '18 at 01:37 AM

It's kind of a weird situation. Maybe explain more why you'd want a "light" to be so specific to see any point on a collision capsule? What are you trying to achieve and why does it need such specificity? That being said you might want to look into making "bones" for your character and you'd have to line trace to each bone and check if one is sticking out, I've heard this was used in uncharted for their AI searching, or look into using DOT products as these are typically used to create a "field of vision"

avatar image Rael5 Apr 06 '18 at 01:52 AM

Well, maybe not necessarily on the collision capsule, that was more me thinking of optimizations; it's just for light detection on a character for a horror game, checking to see if point lights are casting on my character, for dynamic lights, since the light values don't seem to be cached from dynamic lights. I have it just tracing to the character's location right now but I wanted to try to trace to the whole character possibly for better accuracy (ie: see character's hand popping out of a shadow). Tracing to bones could work as well maybe for decent results, but I was hoping there was a method to detect if an object is occluded or not from a specific point.

avatar image Nebula Games Inc Apr 06 '18 at 02:02 AM

A line trace would work fine for that. Your issue is you want to be able to see ANY point on your character and in order to do that you'd have to break your character up into pieces, you have to use bones or make points on the character you'd want to check if they are sticking out, there isn't a simple way I know of to do that. The line trace has to "trace" to something so you need to give it a specific point.

avatar image Rael5 Apr 06 '18 at 02:28 AM

Yea, I was just hoping there was another method beyond the regular traces for that, similar to the rendering scene putting IsVisible on objects if they're not occluded. Thanks for the help though.

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

0 answers: sort voted first
Be the first one to answer this question
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