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"

Obstacle between two points

Hello Please help me how to find no of obstacles between two points. I was creation a building and i want to know the no f walls present between character and an actor. plzzz help..........

Product Version: UE 4.10
more ▼

asked Jan 04 '16 at 11:04 AM in C++ Programming

avatar image

14 7 6 7

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

1 answer: sort voted first

You will have to perform line traces to check if there is something between point A and point B. The trace will stop at the first obstacle so you may want to perform another trace from that obstacle onward to point B again. There might be always some cases where traces are not the most adequate solution so it depends on your implementation and of course your use case and requirements.

Trace from A to B with obstacles in the middle, going from A to B we will find O1 and O2 in the path. So what we do is to do another trace from each hit to B again. It's important to temporally disable the trace response of the hit (O1 and O2) because if not you will get that hit again (you can also ignore the actors by checking the ignore self box if the consequent traces use the hit as the trace actor). So you will end up with something like:

 A ---> O1 ---> O2 ---> B

I would suggest you to start playing around with line traces and multi line traces to see if it's enough for you or not. Check out this wiki post about traces. Another type of traces that may fit your problem better would be a box shape trace.

more ▼

answered Jan 04 '16 at 11:16 AM

avatar image

6.4k 127 99 607

avatar image AMRKC Jan 05 '16 at 05:59 AM

Thanks for the reply...... There are multiple obstacles between point A and B. We need to get details of all the obstacles. Plz help.

avatar image Moss Jan 05 '16 at 07:02 AM

As I said you have to trace your way from point A to point B step by step to know if you will hit. You should also use one of the collision channels, that way you can fine tune what is meant to be an obstacle.

avatar image AMRKC Jan 05 '16 at 10:05 AM

Both points A and B are not stationary. A is the character( First person player) and B is a material whose position will vary. We need to get details like number of walls between A and B.

avatar image Moss Jan 05 '16 at 11:57 AM

so you need to trace and check what us between those points. You can not do that within a material, you have to process it outside, perform the traces through the trajectory, count the walls (or any other obstacle) and once you have reach the end use that value you incremented earlier. It does not matter if they are not stationary, you will just count hits.

avatar image AMRKC Jan 07 '16 at 07:51 AM

Thank U...It Worked......

avatar image AMRKC Jan 07 '16 at 07:53 AM

One more doubt....Is there anyway to find out the coordinates of Hit points (point on the obstacles that the trace line hits). Please help.....

avatar image Moss Jan 07 '16 at 11:07 AM

The hit point you will get from the trace contains a hit location and a hit normal, those should be enough.

avatar image AMRKC Jan 07 '16 at 11:37 AM

Will we get hit location and hit normal of all obstacles present in between??

avatar image Moss Jan 07 '16 at 11:38 AM

You will get a hit for every hit that your race will impact, so yes each hit contains all the info.

avatar image AMRKC Jan 12 '16 at 05:37 AM

Thankzzzzz........it worked.....Thanks alot..

avatar image AMRKC Jan 19 '16 at 05:13 AM

How to use exponential function in an unreal engine c++ project....Please help...?

(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