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?
Have you tried switch from “Visibility” to “Camera” on trace channel?
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.
Then later in the blueprint, I’m doing the trace against everything I can. But this returns false when it should be hitting the generated surface.
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.
Has anyone found another solution besides setting it to Tick? I’m in V4.19 and this is still an issue.
Same issue here, my trace hit points always returns 0-0-0 if it hits the spline mesh component.
Though it only occurs in standalone mode, it works fine in the editor.
4.20 and this is still an issue. Still no progress or change info from Epic?
4.23.1 and still appears to be an issue.
Unless I missed some documentation on the new spline raycasting techniques
has anyone yet found the answer to this problem?
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.