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 to unhide actor components on selection.

I finally figured out how to draw a rectangle and select/move units in my project, but I have no way to mark which is selected and which isn't.

I have a selection circle material I made and it's on the npc; set to hidden by default and what I'm trying to do is quite simple. When they are selected they are added to an array of selected actors, I'd then like to set their circles to visible.

But if I try to reference the material and set it to not hidden in the selection_hud bp it spits out errors and any way i attempt to reference the component or material returns errors.

When you select actor/s they are added to an array of them all and I'm trying to forloop and set hidden to false. Any help appreciated.

Here The selection circle is a material put onto a plane static mesh component on my npc bp.

Edit solved!: Figured it out here is the code for anyone wondering how noticed the internet is light on ways to do some of this stuff. Thanks!

Product Version: UE 4.21
Tags:
more ▼

asked Mar 02 '19 at 07:25 PM in Blueprint Scripting

avatar image

PerCat
39 1 3 7

avatar image ThompsonN13 Mar 02 '19 at 07:36 PM

rather than affecting the material i would just hide the mesh. of course this leads to the question of do all the selectable actors inherit from the same parent? if not it will be difficult to change the visibility on each one directly. you could however create a script in each actor which handles what it does in the event of selection then you could use a interface to call a event which runs the script on each.

what kind of errors were you getting?

avatar image PerCat Mar 02 '19 at 08:11 PM

I figured it out, but thank you. You guys are like the mvps of this place I love how this forum is full of really friendly helpful people to guide us noobs. :)

Gonna keep this up since the internet seems light on some of this more basic stuff.

avatar image Everynone Mar 02 '19 at 08:00 PM

Or just draw material in the hud directly, right off that NPC array by projecting world to screen. Should be significantly lighter on performance since it's just some quads.

Meanwhile you can feed that dynamic material parameters to distinguish between unit types.

avatar image PerCat Mar 02 '19 at 08:11 PM

I ended up getting it. But thanks for being such a great community member! Gonna keep this up to help other noobs as well. :)

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

0 answers: sort voted first
Be the first one to answer this question
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