Im doing a line trace that needs to trigger a hit when the line is cast from inside a mesh.
The mesh im tracing against is using Collision Complexity - Use Complex Collision As Simple.
Im doing a line trace that needs to trigger a hit when the line is cast from inside a mesh.
Why is it inside a mesh? Can you give me more context on what you are trying to trace upon? I might have an alternate solution for you.
It’s an Editor widget blueprint. I am tracing from every vertex of the selected mesh, and then setting the vertices to the line trace hit position. Its tracing against a static mesh. Sometimes the mesh is sticking in or outside of the tracable mesh, in these cases the line trace dosent hit the back of the mesh triangle. I need to get a hit on the mesh from any possible start location.
if im understanding you right should just need to turn off ‘ignoreself’
Oh boy, this is hard to visualise. What about the results? What are you trying to get from the traces? What are the traces for? Can it be replaced by something else? Do share your main goal of why doing this kind of system design will help me understand it better.
Right sorry. So I have a cave mesh (red), around that mesh I have a slightly larger mesh (blue) that I intend to use as the collision mesh for the cave. To make it as flush to the cave as possible, I’m using an Editor Widget BP to move the vertices of the blue mesh. I do this by casting a line trace (green) from the vertices of the blue mesh, and then repositioning those vertices to where the line trace hit. My issue is - since the blue mesh is sometimes slightly outside the red, the linetrace will pass through the red because it is hitting it from the back face, causing a miss, but then later it will hit the first frontfacing face. How do I make it so that the line trace will not cause a miss on the backfasing parts of the red mesh?
You may be doing the trace wrong.
You can only do this on the visibility channel and you have to have the mesh be set to a double-sided material in order to detect the hit. The. Your normals won’t matter (Though they technically still will at times).
You even mentioning complex over simple collision just seems to indicate you misunderstand how the trace should work - or have a flawed idea of how the collision itself work? Elaborate if so, someone will correct you.
However, overall your concept is flawed. Perhaps it goes back to not understanding the collision system. For anything to work correctly (particularly if using physics after the engine changed from PhysX to the the highly unreliable and aptly named Chaos) you are going to want THICK (like 400lbs gorilla sized) simple collision hulls to be placed around the area.
Your best bet is to forget what you have so far, and desin a cave in a DCC where you can export the wall faces and an underlying collision made up of convex hulls (or even better, simple. As in boxes!)
More time consuming? Maybe (some tools out there can make this iteration faster than the engine ever could).
But
Less issue prone and pretty much guaranteed to work across time and space…
I bet if you export your current mesh to blender, look up what a convex hull is, and enter edit mode (tab) theb select a portion of the face and extrude (e) drag out a couple of meters away from the inside of the cave. Separate selected parts (p?) And export the selection as an FBX, then place it in the scene with engine built simple collision you’ll get exactly what you want.
You just have to figure out how to repeat that process for the rest of the wall face…
Naturally this falls apart if you are trying to make procedural things, but the base concept will still matter. You can do exactly the same thing procedurally (just have to know how because the engine is bad at it).