Line Trace for Objects how to ignore actors?

I’m trying to make a blueprint script that prints in the console what you’re looking at when you press the left mouse button. Everything works fine, but the line trace keeps bumping into the player. Moving the camera forward stops it and it works fine, but I don’t want to do that because the camera goes through the walls.
Here is a picture of the blueprint:

I am still new to the Unreal Engine 4 and game making in general, please don’t give me a answer too complicated thanks.

You should add your character into “Actors to Ignore” array. Just cast to your Character and add its output to “Actors to Ignore” input in Line Trace of Objects node. Let me know if it helped.

Thanks but like I said, I’m a complete noob, how do I cast?

Just right click and search for “Get Player character” , drag wire from its output node and search “Cast thirdpersoncharacter” (Or any other character BP you are using), drag its output and attach to “Actors to ignore”

still doesn’t work it keeps outputting FirstPersonCharacter_C
what am i doing wrong ;-;
(I did connect the cast exec to the line trace)

Please add screenshot of your nodes.

It should work. As a workaround you can go with trying “LineTraceByChannel” instead of “LineTraceForObjects” and check if it helps.

it doesn’t work .-.
i’ll just raise the camera above the player i guess ;-;
thanks for trying to help btw

The simple solution is to open your character blueprint, take all the components in the components list, select htem, go the Physics panel in the Details panel and under collission click the arrow so you get the list (camera, worldstatic, worlddynamic etc.) and make sure camera and trace is set to ignore instead of block now traces will go straight through your character.

I bleive your Physics enum array is the error.

I also suggest using the LineTraceByChannel node and then take the return value → break structure and drag off “Other Actor” and do a check if its the item you want (ie you could drag off and do an == (equal to?) node to check if what you traced is the item you select in the list.

You can even do a forEachLoop on the trace after for an array of items using the otherActor information. It will tell you exactly what it hit.

Hope this helps
Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.