x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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: alt text

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

Product Version: UE 4.9
Tags:
blueprint.png (97.9 kB)
more ▼

asked Sep 15 '15 at 12:10 PM in Blueprint Scripting

avatar image

MightyAlex200
13 3 5 6

avatar image ambhar Sep 15 '15 at 12:19 PM

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.

avatar image MightyAlex200 Sep 15 '15 at 12:32 PM

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

avatar image ambhar Sep 15 '15 at 12:37 PM

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"

alt text

line.png (110.6 kB)
avatar image MightyAlex200 Sep 15 '15 at 12:51 PM

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

avatar image ambhar Sep 15 '15 at 12:54 PM

Please add screenshot of your nodes.

avatar image MightyAlex200 Sep 15 '15 at 12:56 PM

alt text

blueprint.png (106.4 kB)
avatar image ambhar Sep 15 '15 at 01:08 PM

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

avatar image MightyAlex200 Sep 15 '15 at 01:20 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Sep 15 '15 at 04:01 PM

avatar image

Nsomnia
1.8k 67 27 137

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question