How to Line Trace in all directions?

Did you set N? ( number of traces )

Did you set the trace node to show the traces?

Yes, you need a trace length, naturally: 1000 will do.

( I will look at the code again now ) Ok, I just looked again. No you don’t need to set anything else, theta and phi etc are calculated during the code.

You could also try taking the BP from @Astrotronic 's snippet, then you don’t have to copy it manually :slight_smile:

( Thank you @Astrotronic )

1 Like

Ok yeah I got it, I did use the snippet but it was missing the value for N and Tracelenght/size.
Now how can I attach this to the BP_ThirdPersonCharacter head?

Off the top of my head, I’d say here

image

Instead of actor location, you need location of the head. You can just put a scene component there in the player.

wait so did you just add a new collision trace channel name “TraceTypeQuery”?
and how/where do you put the scene component? in the BP_thirdpersoncharacter mesh’s head? And how does that help the tracetypequery?

You’re doing the trace from inside the player, right? ( I’m assuming ).

So you need somewhere to do it from. We know that’s the head, but there’s no way to say ‘from the head’, so it’s easy to just put a scene component in the guy’s head, so we can trace from it.

GetWorldLocation of the scene component.

A scene component can’t be seen and uses no space so…

Do you get it?

Not totally, is it the “Scene Capture Component 2D” or “Scene Capture Component Cube” or the just the basic “scene”? And how do you call that in the blueprint for the trace?

And I still dont understand where you got the tracetypequery and how to use it?

Tracetypequery is coming from the BP online viewer. Look at the original code, it’s ‘visibility’.

ok i see it now, so how do I call that in the trace blueprint?

oh ok I have it set to visibility then

oh nice wait so which one do I choose in the trace blueprint?

No it’s not a variable, it’s a COMPONENT :slight_smile:

Add it on the left

image

Yeah I did add exactly that in the BP_ThirdPersonCharacter blueprint, and I’m calling it the trace blueprint. Or is that wrong?

You can call it what you want. Is it working yet?

By default, the trace will come from the actor’s middle.

No I mean I’m getting world location of the scene component I placed in the character blueprint inside the LineTrace blueprint but its not working


Does it work if you just use actor location?

No wait, woaah… what’s going on.

This is ALL in the character. ( I see you have another BP there ).

no no, im showing 2 different blueprints.
Ones the Trace blueprint, and one is the character blueprint

Ok. Does it work, if you use actor location?