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"

How do I make a crosshair appear?

So I have a blueprint which draws a crosshair in the center of the screen however that crosshair is always on the screen. What I'm trying to do is make it so that the crosshair appears when the player overlaps with a trigger and then disappears when the player ends the overlap. Basically the crosshair would be visible as long as the player is overlapping with the trigger. How would I do that? For my crosshair right now, I'm using the Event Receive Draw Hud and it's being drawn in the center of the screen.

Product Version: UE 4.8
Tags:
more ▼

asked Aug 31 '15 at 04:32 AM in Blueprint Scripting

avatar image

Brandon236
88 30 41 45

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

2 answers: sort voted first

Hi!

In HUD blueprint you can add variable, and set needed level of transparency.

alt text

Place trigger volume in scene.

alt text

Add in the Level Blueprint events for change visibility of cursor.

alt text

Or add in character blueprint mouse event for control visibility.

alt text

cursor01.png (256.2 kB)
cursor02.png (376.6 kB)
cursor03.png (214.0 kB)
cursor04.png (121.1 kB)
more ▼

answered Aug 31 '15 at 02:39 PM

avatar image

svv3dUDN
8.5k 255 43 400

avatar image Brandon236 Aug 31 '15 at 09:03 PM

Alright that worked.

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

Simply add a boolean to some convenient place both HUD and your trigger blueprint have access to. Set to true on overlap and only draw crosshair then.

more ▼

answered Aug 31 '15 at 09:33 AM

avatar image

davek
150 13 9 10

avatar image Brandon236 Aug 31 '15 at 09:48 AM

Well I have added a boolean to the crosshair blueprint but I can't seem to find a way to change that boolean with a trigger.

avatar image davek Aug 31 '15 at 10:17 AM

Use the SET node to set a variable... OnBeginOverlap node should lead to Set node.

(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