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"

Event Dispatches Do Not Work In Widget BP

I have spent more than 4 hours and no exaggeration here trying to make this simple code work.

All I want to do is when player collides with object progressbar increases, but it seems like dispatchers does not work.

Widget BP - When I collide with object this event should be played. It should remove 10 from current score, but this event never get fired for some reason alt text

alt text

Object BP - When collided It supposed to fire event in a widget bp, but it does not.

alt text

Level BP

alt text

Product Version: UE 4.13
Tags:
w bp1.png (135.4 kB)
w bp.png (100.2 kB)
bp.png (98.9 kB)
level bp.png (104.0 kB)
more ▼

asked Jan 11 '17 at 11:57 PM in Using UE4

avatar image

deropke
1 2 1

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

1 answer: sort voted first

What's the value of your two variables CURRENT and MAX?

The UMG ProgressBar is empty at 0.0 and considered full (at "100%") when it's value is 1.0.

Therefore make sure your progress bar value range is from 0.0 - 1.0 and not 0.0 - 100.0.

Instead of doing CURRENT - 10.0 you should be doing CURRENT - 0.1 and make sure the CURRENT variable has a default value of 1.0 and not 100.0 if you want the progress bar to start in the "Full" position.

more ▼

answered Jan 12 '17 at 12:25 AM

avatar image

elitereloaded
694 24 24 55

avatar image elitereloaded Jan 12 '17 at 12:30 AM

EDIT to my above answer.

I re-read your post and you clearly stated you want the progress bar to increase and not decrease.

Set your CURRENT variable default value to 0.0.

Update your SCOREUPDATE_Event so it adds instead of subtracts. You should be adding CURRENT + 0.1 (1/10th of the progress bar's "full" state).

avatar image deropke Jan 12 '17 at 12:40 AM

Sorry this was my mistake. I do want it to increase, but the tutorial I used was for decreasing health, If I could get that working I could change it so it increases. The values are 100 for both and I used print string to find problem and the event in Widget never fires.

I also used to get "accessed none trying to read property" error but I fixed it by deleting everything and start over, so don't know where the problem was.

avatar image elitereloaded Jan 12 '17 at 12:44 AM

Read my additional comment from 3 minutes ago. Don't try to create the UMG widget on the "server" unless there is a local player controller. In dedicated server mode the dedicated server can't have any HUD components.

avatar image elitereloaded Jan 12 '17 at 12:39 AM

Here's some screenshots that show my working example based off the ThirdPerson starter project.

This is my level blueprint, it's slightly different than yours. On actor overlap I call an event that is set to reliable Replicate to Owning Client.

I also put in checks so we only create the progress bar UMG widget and dispatch it's SCOREUPDATE event IF there's a local player controller. When running in dedicated server mode there's not a local player controller (hence there's no "UI" or "HUD" available). So we don't want to create the UMG widget if there's no local player controller (and we definitely don't want to try and access the UMG widget instance).

alt text

In the UMG progress bar widget i'm adding 0.1 to the CURRENT float variable that is bound to the progress bar.

alt text

avatar image deropke Jan 12 '17 at 01:24 AM

Thank you so much for such detailed explanation. Anyways it started to show some signs of live, but it still not quite there. For some reason it ignores the first collision then reacts to second one and then ignores the rest collisions.

avatar image deropke Jan 12 '17 at 01:27 AM

Ok nevermind, It only react to the one I select when adding OnActorBeginOverlap.

I tried doing this, but it still only works the one I select

Widget BP

alt text

Level BP In brackets it shows which one I have selected and it will be the only one working.

alt text

s2.png (84.9 kB)
s3.png (78.7 kB)
avatar image elitereloaded Jan 12 '17 at 01:53 AM

Are you testing this with multiple players? Are you using a dedicated server?

I can see from your second screenshot that your SendScoreUpdateToClient is not set to replicate to owning clients.

avatar image deropke Jan 12 '17 at 02:00 AM

It's FirstPersonExample running on my pc for college project, so I don't think it's either of them. It seems that making SCOREUPDATE event fire from level bp fixed the issue rather than checking if there is local player. But I still need help as It only react to the one I select when adding OnActorBeginOverlap.

avatar image elitereloaded Jan 12 '17 at 02:11 AM

Can you post screenshots of how the Box component is setup? Is it a Box collision component or a static mesh?

avatar image deropke Jan 12 '17 at 02:17 AM

It's a sphere surounded by box collision. alt text

Also Full Object BP incase you need it

alt text

s01.png (273.0 kB)
s02.png (180.6 kB)
avatar image elitereloaded Jan 12 '17 at 02:38 AM

What happens if you stop the execution right before you call Spawn Emitter At Location so the actor and components don't get destroyed?

I.e. does everything work if you only execute the code that moves the progress bar forward?

avatar image deropke Jan 12 '17 at 02:52 AM

Nope, still only the one that I select.

It's 3am and I have to wake up at 8 so I'm going to sleep, hopefully you will continue helping me, because I don't think that there will be another person who will read all this to continue help me.

Thanks anyways

(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