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 switch ability widget on/off depending on which character is possessed?

I am working on a multi-character RPG and I need to make it so depending on which character I am using, it will turn off other character's action widgets, but turn on its own action widget. Action abilities and the widget changes are held in parent character that other characters inherit from, but each character has its own ability WBP. I have turned off the WBP that the parent character uses, and I can turn on my "Shooter" and/or "Healer" character WBP, but I haven't figured out how to turn them off and on when the proper character is possessed. In the parent character, I thought about casting to the character as seen in the pic, but I either don't understand the cast, or that's not the way to do it. The Remove Widget pic may or may not be needed to understand whats going on, but I believe it is imperative and has no problem.

As a rehash, my goal here is to get the ability widgets to switch and stay with whatever its character is only when that is the current character.

PS, in order to get the widgets to disappear, I have used the system found in this forum post here:

https://answers.unrealengine.com/questions/285012/toggle-visibility-of-umg-widget.html

Many thanks ahead of time.

Product Version: UE 4.14
Tags:
failedcast.png (147.4 kB)
menuwidget.png (221.1 kB)
removewidget.png (97.4 kB)
more ▼

asked Jun 12 '17 at 07:48 PM in Using UE4

avatar image

bcValor
1 1 1

avatar image zipzit Apr 18 '19 at 04:55 AM

What does the abbreviation WBP stand for?

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

1 answer: sort voted first

So I solved my problem and this is how: 1.) I had to create a new action controller for each character that dictated AND created the widget for their own abilities. This eliminated the need for casting. I had to get the WBP reference, right click and check "convert to validated get" which was something I didnt know how to do at first. The ball was rolling from here. That way, the specific create widget node could reference itself. 2.) I also had to create an interface for each character dictating the hide/revealing of said characters own ability widget. Each character had to reference that specific interface and not the generic ability interface, which at the time I had to disconnect. (Note that the parent must NOT be connected to the child character's ability widget interface--otherwise they will interact with the wrong widget visibility) 3.) I also have a BP that dictates what happens when an action is taken, and that needed some work to prevent an "Accesssed None..." error. What I did here was check if the widget was valid before trying to remove the widget. This was critical to eliminating constant error feed of not checking before acting.

Thats about it! Hope it helps someone else, if not thats ok too. After spending two weeks being stuck, finishing it a day after posting works for me.

more ▼

answered Jun 13 '17 at 08:42 PM

avatar image

bcValor
1 1 1

(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