Line trace ignores a specific object and doesn't work

Hi!

A strange thing happens with line trace. It works on every object I want to interact, except one type.

I have to change material by clicking on the object; I had opened another thread thinking I was wrong to create the blueprint. I then tried the same code on another mesh and it worked. I decided to open this up so that the question matched the subject.

I have two certainties: the line trace works and the scripting too, so what’s wrong with it?

I suppose, but I am still a beginner, that the line trace doesn’t find the surface to hit because the object is thin even if it has a thickness, it has been solidified. Maybe it’s a problem in the collision? It’s set to use complex collsion as simple.

I hope someone can help me :slight_smile:

This is the line trace blueprint

This is the object blueprint

This is the mesh

Hi, if you think it is not being hit because its too thin, then you can set it to use simple collision as complex and then add a sufficient large box collision to it (inside the static mesh editor) and then see if it gets hit.

Thank for your reply!

Unfortunately doesn’t work either with simple collision as complex and a large box collision. Now I’m doing some tests with Blender, maybe the problem is in the mesh? I don’t know…

UPDATE

Yep, the material actually changed but the wrong one.

My mesh had multiple slots and I didn’t know I would have to specify which one to change.

I added the element index and solved it: