Download

line trace starting at my feet

Hi guys the title may be a little vague but basicly i am currently building a tree cutting mechanic and im currently following this tutorial https://www.youtube.com/watch?v=F_RS1vlBYXI however at around the 11 minute mark im getting a little frustrated and cannot seem to continue. My line trace fails around 80 percent of the time to detect the tree. Due to the trace starting at my feet .And the fact i have quite bumpy terrain … I have tried moving the origin of my character as i assumed this was the problem . but it did not work and caused a lot of problems. can i not add something to my bp to make the origion of the line trace higher on my characters body??

i hope this makes sense guys its late loleb0809d5d7511630a679bb8038204e49a452c9ed.jpeg

Few ways you can solve this. Easiest way is to get the capsule world location instead of the mesh. It’ll default to the middleish of your character.

Alternatively you can do an add vector to the start and the end and add like 100 to the Z axis so it’s up higher

another option is to make an arrow component or a socket and place that where you want and use it instead of your mesh to get the trace locations.

You should try Pinworm’s advices, because they will certainly work. If your character is always facing the direction you are looking into, just use the “Get actor forward vector” and replace it with your forward vector and delete the “Get Actor Rotation” node.

The big problem of you is that u use the Visibility Channel for your trace, and u let the trace so close to the terrain, and you use single line trace, its only return the 1st object that blocking hit, so i think it will return the terrain 80% of the time. The effective way to do this is to make only tree dectect line trace collision, for your project, its visibility channel, and i sugget u use sphere trace instead of line trace because line trace is too small, let say if u going up a hill, the line trace’s detection will be wrong.

Thanks guys all of that seems to make a lot of sense lol ill let you know how i get on

Thanks guys that was a very simple fix … Thanks again