I have a blueprint that takes a selection of actors and deforms them along a spline using the SplineMesh component. Later on in the same Blueprint, I create a spline and I want to LineTrace this down onto the SplineMeshes and find the intersection points. I have everything working with one exception. The LineTrace does not detect intersections with the Spline Mesh. It simply passes through it. It will detect anything else in the level. It wont even detect a SplineMesh from another Blueprint.
Is there a reason why a Line/MultiLineTrace does not work with SplineMeshes? and more importantly is there a solution to getting the intersection point with this mesh?
I have indeed. I have tried the line trace and multi line trace as well as type trace (multi and single) both types of ray cast/trace do not appear to detect spline meshes.
I’m imagining that a splinemesh is slightly different in the engine and that its not being included in the test… I just wondering if anyone has had any success in doing this?
I just tested here with a prototype and the line trace is working, so, could you double check if on the details panel of your AddSplineMeshComponent node on your construction script has collision enabled to “BlockAll” and also your mesh as a collision added?
If I create the component in the viewport, as you suggest, then yes this works and I can see the collision hit. But unfortunately, I’m creating this component in the construction script - at which point I fail to get any collision hits on the surfaces. In the blueprint, I am setting the collision of each of the splineMeshComponents to be blocking all.
It looks like, for some reason, there is an issue when you generate a SplineMeshComponent vs having one setup in the component list of the blueprint - Even if you are setting the collision information to be the same…
Just some further information on this. If I do a ray test in the event graph “Tick” - then I get the correct intersection result. It seems that there is some update order issue and that the deformation of the spline mesh components is not being done at an appropriate time for the ray trace to work in the construction script.
I found out how to fix it; you simply have to enable the correct collision within the detail panel of the “Add Spline Mesh Component” node. Changing the collision afterward will not affect the response to the ray trace. Or it will at least scuff the result of the trace. It would probably be best to not interfere with the collisions of that mesh outside of the detail panel.