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"

Completely hiding widget elements

Hi, I am making a local multiplayer game, and I have made a menu, where you can choose the number of players, and then each player can choose their car (it’s a racing game) in their own collumn, like in the game Crawl : https://imgur.com/Arvluoh
But the problem is that I haven’t found any way to hide the collumns, for example hide the fourth collumn, when you choose to only play with 3 players. I could use the set visibility node, but then it would just hide the collumn, and not adjust the other ones to center them. So what I want is to hide them, as if they weren’t there.
Maybe some of you have knowledge in web development, and what I am trying to acchieve is the equivalent to the CSS display: none.

Product Version: UE 4.21
Tags:
more ▼

asked Jan 05 '19 at 09:40 AM in Everything Else

avatar image

ZOSK_
5 1 3

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

1 answer: sort voted first

Do you really need to have the fourth column in the background when no fourth player exists? If you don't, you could create the columns as sub-widgets in a loop (looping over as many players as you wish). Then you could display the columns depending on the existing amount.

I did that similarly in one of my own projects. In the "Event Construct" of a overview widget, I created multiple elements ("sb mastered jobs list" is a box in my overview widget): for loop create sub widget

loop-example.png (110.8 kB)
more ▼

answered Jan 05 '19 at 10:48 AM

avatar image

mistercokes
1 1 3

avatar image ZOSK_ Jan 06 '19 at 12:01 PM

Thank you mistercokes, Your solution seems to be what I need, but how can I remove the collumns afterwards? Do they remove themselves when you remove the widget from parent ? Because if you choose to add four players, and then want to play with only three, would I have to reconstruct the widget with 3 players, and would that have removed the fourth collumn ?

avatar image mistercokes Jan 06 '19 at 03:25 PM

I just tested with the example above, a simple "Remove Child" was enough to remove the column after widget creation (see attached picture, in this case triggered by a button in the widget).

So if you want the person to be able to change the player count in this overview itself, you could e.g. always remove the last entries to fit the column count.

Afterwards, starting the game, you could then check for all existing children what values have been entered.

remove child from widget

remove-child.png (74.0 kB)
(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