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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Line Trace by Channel against Box Collision - Problem

Hi Guys... I am trying to learn UE4 currently and made already some interesting learnings.

But now I have a problem which I can not solve alone... I am trying to make a tree which grows by time and if he reached his max size spawns other small trees randomly next to him. It is nearly working.

I gave the tree blueprint a tree model component and a box collision component (which should be used for detecting regions where the tree may NOT spawn) I calculate a random position within a min and max radius and than take this position + z 800 to make a line trace to the target position to calculate if one of the tree collider was hit (there is a own trace channel for this purpose, and the collider is set to block this trace channel)

But the trees even spawn in this collider :( I already tried a lot of stuff maybee someone of you could help me?

alt text

alt text

Product Version: Not Selected
problem.png (715.1 kB)
spawn_function.png (352.4 kB)
more ▼

asked Mar 25 '15 at 01:07 PM in Blueprint Scripting

avatar image

10 3 5 11

avatar image alperenakyuz Mar 25 '15 at 04:35 PM

Have you checked if the box collision is set to "block all"?

avatar image DarklinkFighter Mar 26 '15 at 08:52 AM

The ForestChecking Channel's default is Ignore. But on the Box Collision Component I set the collision to custom. The object type of the collision is WorldDynamic. All is set to ignore except ForestChecking, which is set to Block. I thought that is the correct setting. So it isn't?

avatar image alperenakyuz Mar 30 '15 at 09:59 PM

Try checking blockall and work your way from it. It might help.

avatar image DarklinkFighter Mar 31 '15 at 06:32 AM

Didn't even work with block all or custom set to only block... At work with a reproduction project the fix was to create a new channel. But this fix did not work on my project at home. But I fixed it now... Strange behaviour... I put all the green nodes which calculated the random posotion in a new function and triggered this function before the line trace... Then it worked o.O

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

2 answers: sort voted first

Hi Darklink2000,

what i would suggest you to Debug you collision is simply to link a function or a custom event in your event tick serie of node to allow you to display via UMG or even via Text component added on your Tree blueprint and get the collision channel and response from your object. It quite simple and it will allow you to check immediatly what is the channel and setting of your current actor collision.

Keep the good work !

more ▼

answered Mar 26 '15 at 10:21 AM

avatar image

91 6 10 13

avatar image DarklinkFighter Mar 26 '15 at 11:06 PM

I tried to make the debug output. Everything seems to be correct. The text was Custom like I set it. I even tried to set collision object types and response channel via blueprint but the trees still spawn in the collider area :/

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

Hi Darklink2000,
I've got a similar problem right now. Looks like the LineTrace function simply does not 'see' actors or components with custom trace channel that was set to Block inside Collision settings.

However, looks like this does not work with certain channels only. For me in my project only one 'problematic' channel appeared: the only one trace channel did not work, while other custom Channels were blocking the trace as expected.

The solution in this case for me was just to create a new custom trace channel and assign it to the LineTrace function and to component's Collision settings as Block.


more ▼

answered Mar 30 '15 at 12:37 AM

avatar image

75 6 11 13

avatar image DarklinkFighter Mar 30 '15 at 06:32 AM

Hi Revenvik, thank you very much for your awnser. I'll try this today in the evening and let you know if it works.

avatar image DarklinkFighter Mar 30 '15 at 09:12 AM

Tried it at work with a blank dummy project cause I couldn't wait^^ Seems that the first channel was not working... Than I added a second one and it realy works! Now the other channel does also work :)

So it could be a unreal bug?

Thanks for your help <3

avatar image Revenvik Mar 30 '15 at 03:39 PM

You're welcome :) Yeah, it looks like strange bug. At least it works in a very unintuitive way

My trace channel was penultimate in the trace list, but i've accidentally noticed, that other custom channels are working, so i've created the new channel and it was a workaround for me. Initially 'bugged' trace channel still does not work however.

(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