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. 

How could I get the current target in a first person view?

Hey,

I would like to know how can i get the current target in a first person view. I have a crosshair, and how can i get the actor i am looking at? Is there a built in function or i have to loop through all actors and find the closest one?

Product Version: Not Selected
Tags:
more ▼

asked Jul 25 '14 at 11:42 AM in Blueprint Scripting

avatar image

Azarus
1.9k 60 50 189

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

1 answer: sort voted first

Use "Single Line Trace For Object".

You can set "start location" as camera location, end location as "camera's forward + 100000 (the length of Target Searching)

And there is a return value called "OutHit"

Spilt it and you can see "Out Hit Hit Actor". this is what the trace hit.alt text

5.png (50.9 kB)
more ▼

answered Jul 26 '14 at 05:49 PM

avatar image

Smomo
179 13 17 33

avatar image ClaverFlav Jul 26 '14 at 08:03 PM

trace for objects can be annoying. mainly cause you have to make an ObjectTypes array, and it boggled my mind how to make it when i was(probably still am) a noob.

trace for channel works quicker, but only if you know/have setup what channel your target actor is on... i think the default is WorldDynamic.

avatar image Azarus Jul 26 '14 at 08:44 PM

Hey, I already figured out i can use tracing method to find the target. I was hoping there is a built in function for this. Thanks anyway.

(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