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"

Hide a 3DWidget

Hi , i'm about to create a blueprint who allow to the players to see their names on top of each player with a 3DWidget. The problem is, that i want to hide the name if there is an object between the player field of view and the other names of the other players.alt text


Product Version: UE 4.16
playername_1.jpg (47.9 kB)
more ▼

asked Jun 01 '17 at 05:36 PM in Blueprint Scripting

avatar image

3 1 2

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

You're likely using the "Screen" option instead of the "World" option for your Widget component. In the settings for the Widget Component, change the Space option to World instead of Screen. Screen will render the text in screen space which means it will always clip in front of Objects in the world.

Let me know if this helps :)

more ▼

answered Jun 03 '17 at 06:39 AM

avatar image

Reuben Ward
343 8 4 16

avatar image Poplix Jun 03 '17 at 01:53 PM

Thanks you ! The widget work really nice :)

avatar image Reuben Ward Jun 03 '17 at 02:14 PM

Awesome :D Make sure to mark this answer as accepted so the questions shows up as solved

(comments are locked)
10|2000 characters needed characters left

You can use two checks to achieve that, first one that checks if the player is close enough to any of the other characters by looping trough all of them every 5th frame or so, then if some are close enough make another check using a line trace from the player to that/those characters to ascertain if the player can see them, (the only reason for delaying the checks somewhat is to try and minimize any performance impact if you are checking against many characters/complicated terrain collision).

This type of checking is kinda basic since it ignore foliage or other types of partially covered characters, but it should work for you at the moment based on your image so I would recommend it. You could also try and put up a system using ue4's perception components but hat involves more options and can sometimes be more complicated to use cleanly.

more ▼

answered Jun 01 '17 at 05:57 PM

avatar image

376 12 5 17

avatar image Poplix Jun 01 '17 at 06:52 PM

Im sorry , Im beginner in unreal engine and i have a difficulty to understand what i need to do . If you can take a screenshot of the blueprints . Thanks you !

(comments are locked)
10|2000 characters needed characters left

make an array of type actor reference in your character with references to all the enemies at begin play, either by making each enemy "add" self by casting or maybe as a temporary solution use a get all actors of type node if you only have one actor type atm.

do a foreach loop using that array.

Inside that loop make a branch and check the distance to the actor, (location - location < the distance you want), if true make a linetrace to that actor from you player character, if the trace returns the same actor as you are checking in your loop atm, (drag a node from the loop actor ref = it to the actor hit from the trace), then cast to that actor and run a function in it displaying its name.

Im at work atm, so I could possibly make a graph when I get home, hope that helped.

more ▼

answered Jun 02 '17 at 08:15 AM

avatar image

376 12 5 17

avatar image Poplix Jun 02 '17 at 07:27 PM

I try this but i have little knowledge in unreal engine and its difficult i dont really know what i do , when you speak of "array and references to all the enemies" I didn't succeed :/ if you can screenshot your blueprints . Really thanks for what you do .

(comments are locked)
10|2000 characters needed characters left
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