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.
asked Sep 15 '15 at 12:10 PM in Blueprint Scripting
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here