How to Line Trace in all directions?

You need to have the pivot point totally aligned with the mesh. If it’s like the FBX of the segment, the X axis of the pivot is pointing along the mesh.

You spawn the mesh at the same location you’re doing the scan from, but you need to get it pointing in the right direction. You can do that with the forward vector of the trace.

Gimme 5.

I understand what you are saying but have no idea how to blueprint that lol. Ok cool, btw so then could you also get it to cut off the mesh at the trace hit location?

It’s a look at

cones

The scale of the cone / pyramid is basically related to the distance between the source and the hit point

I only set the length here.

for some reason the meshes arent showing up for me…

You have to set the mesh

I did, and its also going extremely slow

Well something is happening lol

Told you it would hit the frame rate :slight_smile:

Ah - if you have this on tick, you also need to destroy all the cones on each frame

image

Something like that, except using ‘static mesh component’ might also destroy some parts of the player.

They’re spawning at the actor location, not the scene location.

No that didnt work, nothing is showing up. I dont know what I’m missing here :face_exhaling:

where is V2 connected btw?

Its giving this one weird mesh when I jump in the first one where V2 is set to location, but it doesnt even seem to follow any proper line trace?

Second one V2 is set to trace end, giving this one weird flickering trangle

Also in your example its on a basic blueprint not the character, but listen could you please again check how the guy adds the mesh in his tutorial. He’s using an instanced static mesh and some extra steps to get a really nice procedural mesh effect proper and its performant in his example. If you could help me convert that part for our use case that would amazing!

Let’s get it working first ( I could do it in the character, no problem ).

What do you mean by V2?

You had some meshes, what happened to them?

PS: Ah, that V2…

I put the code in the character. This is how the end is connected ( you might also need to switch the collision off )

character trace

Dude I dont how thats working for you (aside from them randomly disappearing). I’ve copied all your blueprints exactly and turned off collision for the mesh everywhere. I dont understand whats happening?


Its like they are not even keeping shape or following the traces properly and seem to keep multiplying

Here is the blueprint in my character




I reimported the mesh, and now this is what I am getting:

And this is after increasing the set world scale, but they are not colliding, they are just going through meshes and also seem to just multiply over time:

After adding your destroy component at the end of the blueprint:

I get just one mesh (which I cant tell if is actually aligned on a trace), and its still going through meshes without any collision

After some scale tweaks, the more you move the more it multiplies and worse it gets and you can see many of the traces do not have one. They still dont collide with impact point


The destroy goes at the start of each tick

Apart from that, I think you have it. ( not having the destroy will mean they just keep multiplying ).

Ok yeah that fixed crazy multiplication issue (I changed material), buts its still pretty glitchy and doesnt always collide properly with clipping issues. Also some of the traces are missing the mesh and sometimes it doesnt fully extend till the impact point properly

Picture without any traces lines to show the bugs:

And that, is a scaling problem.

My mesh was a cone 1 unit high and 1 unit radius, so I can just scale easily. You either need to change meshes, or figure out how to get your scaling the same as the line trace.

PS: You can make the cone very easily with the new geometry tool

image

( it’s tiny ).

Ok I created the cone using the modeling tools and got this, its still really glitchy and clipping:

You want the cone to be aligned with the trace. So this

should be coming from where the trace is starting?

Also, the cone needs to have X pointing along the correct axis

image

( The look at node points the X axis forward )

Yeah, impossible to get that pivot facing the right way with the UE tools. I’ve attached mine

Cone_1Unit.FBX (25.3 KB)

Ok using your cone fbx helped with facing the right way, but its still clipping through meshes and not stopping at impact point in some cases. Also, when I move backward or jump, it causes some of them to just disappear or shift randomly

What does your code look like in the spawn mesh / scale part now?