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"

Healthbars disappearing when ai goes offscreen

Hi everyone! Can anybody guess what's happening here?

alt text

The blueprint scheme consists on a character blueprint (enemy) containing a reference of the widget blueprint (healthbar). The enemy blueprint creates the widget during the EventBeginPlay as follows:

alt text

And the healthbar widget graph looks like this:

alt text

I've tried adding the widget to viewport every tick (on the enemy blueprint) but it didn't work (the isInViewport boolean always returns true). I would try to fix this in a patchy way, but I don't even know what originates the problem.

Any help provided would be appreciated!

Product Version: UE 4.9
more ▼

asked Oct 10 '15 at 08:45 PM in Blueprint Scripting

avatar image

13 1 3 6

avatar image necrobooder Oct 14 '15 at 10:31 AM

Still happening, if anyone could provide any sort of help or clue it would be inmensely appreciated!

avatar image Lostra01 Oct 14 '15 at 12:28 PM

Did you try to make a 3D widget in world, and make that appear over the head of the AI facing the camera all the time? That way even if you go off-screen it should stay in location.

avatar image necrobooder Oct 14 '15 at 12:48 PM

Not sure if I understand you, isn't that what I'm doing in the blueprint? Or do you mean literaly drag a widget to the level and link it with the enemy via parameter?

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

2 answers: sort voted first

It seems Event Tick stops getting called when it goes off-screen in 4.9. Workaround is to have all your Event Tick functionality called on a timer instead. See https://answers.unrealengine.com/questions/296904/widgets-are-disappearing.html

more ▼

answered Oct 16 '15 at 04:50 PM

avatar image

354 13 9 25

avatar image necrobooder Oct 16 '15 at 06:36 PM

Yeah! that was it. As you point, it is problem with EvenTick not geting called when the widget was offscreen. I swaped the EventTick node with a custom event (called "Update") and call Update from EnemyBP EventTick. This method is even better than the original EventTick (assuming it worked) because you ensure that the Widget will not operate when you destroy the actor that "owns" the healthbar.

Again thanks a lot jaragoondoo and best wishes of luck for your projects!

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

If it's just the healthbar you want (no text, names etc.) it would be more practical to use a billboard material. You can create a healthbar in materials by using a linear gradient and clamps.

more ▼

answered Oct 16 '15 at 03:18 PM

avatar image

2k 62 24 111

avatar image necrobooder Oct 16 '15 at 04:28 PM

Problem is I interact with the healthbar on hovering and click (and not only by doing so on the healthbar itlself but on the actor too or even other actors). I'm sure all of this could also be done with billboard material as you state but I'm more interested in knowing what causes this more than changing the implementation. Thank you by the way!

(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