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 do Targets work in Blueprints?

I have been browsing this site trying to find some really basic overview on how targets work in Unreal Engine blueprints and haven't found anything. All I need to know is how it works, nothing fancy nothing complicated. How do you add a reference to an object within the scene as a target, etc.

Product Version: UE 4.17
more ▼

asked Aug 31 '17 at 06:19 PM in Blueprint Scripting

avatar image

1 1

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

1 answer: sort voted first

You are looking to find information on how to click on an object and get that object to be referenced as your 'current target'?

Basically, you would first create a blueprint that knows where your mouse/cursor location is in relation to the screen. If it's a FPS and locked in the center, it would work the same. Then, add some type of blueprint that would know what is 'under' your cursor (set some kind of variable depending on the game). These BP's would depend on how your game works. For example, maybe you can only click on objects that are nearby. Maybe when you cast a spell, your cursor image changes (and only then does the click 'do anything').

Once you have that set up, you need to do something with the info of what you hit. So, you would have some kind of variable like 'cursor target' and if you clicked on an AI/NPC character, do X (maybe set a 'character target' variable), if you clicked on an object do Z (maybe set a 'object target' variable).

A very important thing you might want to look into is the 'cast to'. You can also find an example project with similar mouse functions to what you are looking for and just copy/tweak the BP's.

more ▼

answered Aug 31 '17 at 07:11 PM

avatar image

366 3 2 12

(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