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 gives result from previous set of line traces

Hi, I'm using v4.7 P8 and I've been working on a trigger based cover system, where I'm trying to retrieve the active cover and the two adjacent covers (if any) upon a right mouse button event. For this purpose, I have created a new trace channel and new trace object to be used for cover traces and cover collision check. But before getting into the collision, I decided to a trace check using right mouse button click to get any active cover in the clicked location, and it's two adjacent covers: one to the left and one to the right. I'm using a static mesh in the trigger box to display the cover when queried. Here's what it looks like in action:


As you can see, my trigger boxes have arrows pointing towards the cover mesh in order to determine the cover direction. I use this arrow forward vector and then start line tracing by adding 45 degree angles to it, in order to cover a 360 degree angle roughly. The first time it work well. If I click outside in any area with cover, all of these are hidden, the arrays all cleared as well. So I made sure that there are no left over data from the previous line trace every time I right click.

Now instead of clicking on any area without trigger, I go ahead and click on another cover trigger space. As per the above logic, it displays the active trigger and it's two adjacent trigger. However it also displays the last hit trigger from the previous set of line traces. This means the left trigger from the above image, which happens to be hit last in the previous 360 deg line traces, get added to the result as well. Upon debugging, I found that my line trace locations are all correct and that this extra trigger definitely lies outside the trace space. But it becomes visible somehow. Here its:


If I click on the same location again, the extra trigger is hidden, because now the extra trigger will be based on the subsequent line trace, which happens to be the same as the left trigger in the above image. Since it's already displayed, we don't notice anything. But however if I right click back in the first cover location, the extra trigger becomes visible. Going through breakpoints, everything goes fine until the line trace, even the input locations, however the first result in a set is retrieving some old value. The debug lines do not go till extra trigger as well. I've gone through the code many times, I've rewritten the same code in v4.6, yet still facing the same issue. It could very well be some logical error in my code as much as it could be a bug. So I'm willing to share the code if you guys aren't able to reproduce it.

Product Version: Not Selected
more ▼

asked Feb 23 '15 at 10:36 AM in Bug Reports

avatar image

1k 83 75 118

avatar image alperenakyuz Feb 23 '15 at 10:23 PM

Sounds like the engine is not updating the output of the node. Try storing it in variables. Make sure to clear the variable before the line trace. That may not be the solution but would signal what's happening.

avatar image Stormrage256 Feb 24 '15 at 04:34 AM

Yes, I've been doing that. I take the hit actor and store it in an array while checking if the array already has that actor or not. For the first time in a new set of line traces, it always get the last line trace hit actor from the previous set of line traces. I've tried storing it in any additional variable as you suggested. I set the variable to null before every line trace. I'm getting the left over trigger for the first time, even though the line trace start and end locations clearly do not include it. I have to make some logical changes to the adjacent cover array storage to include the validity of the trigger in relation to the active context, but I'm unable to proceed any further without fixing this issue

avatar image Maverinox Feb 24 '15 at 05:13 AM

This isn't really a solution, per say, but rather a possible work-around(?)--have you tried, after the right-click occurs and the second set of triggers appear, to check the location of the trigger you entered and activated, and do another check to see if any results lie outside the radius?

I feel like a secondary check, that checks distance via actor locations, discarding any that are out of it, may be a possible temporary solution

avatar image Stormrage256 Feb 24 '15 at 05:19 AM

Thanks a lot Maverinox, I'll go with that for now. I'm anyways specifying the distance for the forward vector multiplier, I can link that to check the distance.

But I would like to see if there is some official fix, because the line trace clearly seems to be giving wrong results in this particular situation.

Edit: Come to think of it, I will have to check the distance to the mesh to which the trigger arrow points. If I don't do that, it will create complications in certain situations where there are close by adjacent meshes. And doing this distance check might probably keep the unwanted triggers out of the context, unless there are some mesh positioning situations that I haven't thought of.

avatar image Maverinox Feb 24 '15 at 06:03 AM

C; Right on

avatar image Stormrage256 Feb 24 '15 at 07:49 AM

Well, things got back to being weird again. No matter whether I'm clicking near the mesh on the right or the left, it is referencing the mesh from the right upon line trace hit from the trigger. This happens even when I remove the left mesh and use a line trace of up to a 100 units from the cover triggers on the left, which clearly rules out the mesh on the right. I clear all the arrays and set all mesh and trigger references to null at the start of every right click. Yet it keeps going back to the old references after the hit result.

Edit: Even tried keeping a delay of 1 second after clearing the references just to make sure that it was all taken care of before proceeding to line trace. But makes no difference.

avatar image Awyan Mar 07 '15 at 06:04 PM

Did someone eventually figure this out? Just encountered the same problem. The line trace is clearly NOT hitting anything, but i still get a hit-return. alt text

If i try to do a line trace somewhere else, and hit an object, the refrence changes to the latest traced object.

Any help would be greatly appreciated.

linetraceissue.png (805.1 kB)
avatar image Stormrage256 Mar 08 '15 at 01:06 PM

I haven't checked on that after the initial post. I'll see if this is working in 4.7.2 and let you know.

avatar image spyro Apr 13 '15 at 11:37 AM

Can confirm this, having the same problem. I put the result in variable, check the current result each time against it and continue only if different.

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

1 answer: sort voted first

Hi all,

I was able to reproduce this behavior in 4.7.5, but it appears to already be fixed in our internal build. The fix should be included in a future release (probably 4.8 or a 4.8 preview). I've moved this post to the Bug Reports section for tracking. If you see this behavior again after the 4.8 release, please let us know. Thanks!

more ▼

answered Apr 14 '15 at 07:44 PM

avatar image spyro Apr 14 '15 at 07:48 PM

Many thanks. This is driving me crazy.

avatar image Stormrage256 Apr 15 '15 at 04:12 AM

Thanks a lot man.

avatar image crackboom Apr 17 '15 at 05:40 PM

I'm seeing this bug in the 4.8 preview

avatar image Ben Halliday STAFF Apr 17 '15 at 05:46 PM

Hi crackboom,

Can you point me to the GitHub version you used? Thanks!

avatar image crackboom Apr 17 '15 at 08:48 PM

Sorry, I don't know the github version. I'm a dev at zombie studios/hardsuit labs and I'm told we were able to get a 4.8 preview build from your perforce, and that we don't know which revision it was. The About section just says 4.8.0-0+UE4. That may not help, but thank you for checking up on it.

But upon some more testing, I may have been mistaken. The problem I was seeing was that a Line Trace for Objects that I know was hitting nothing was still returning a Hit Actor of whatever the previous Line Trace for Objects that did work. But I didn't have a Branch for the Return Value of the Line Trace. Adding that branch gives the expected behavior.

avatar image Ben Halliday STAFF Apr 17 '15 at 09:23 PM

Ah, okay. That should be pretty similar to our Promoted branch from GitHub.

I tested this in our promotable from the 10th, and the Display Name given for a Hit Actor is null when there is no hit, regardless of using a branch. My setup looks like this for my trace:

alt text

If a similar setup is displaying a name for you, please let me know, or otherwise if you could show me your BP setup that could be helpful. Thanks!

avatar image crackboom Apr 17 '15 at 11:17 PM

I tried that exact set up and a name is still displayed when there is no hit. The earliest date I have in our perforce is March 12, 2015, so maybe we got a version just before the fix was in? But it looks like it is all good to go on your end, I have the desired behavior for now on my version, and we'll be upgrading anyway once the real 4.8 comes out.

Sorry if this just created confusion, but I appreciate the diligence!

avatar image Ben Halliday STAFF Apr 20 '15 at 03:02 PM

It's certainly possible it was fixed between March and April, but I'll have to build the March 12 version to double check. Glad you have it working how you need, for now! Please let us know if you still have trouble with this after 4.8, as well. Thanks!

(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