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"

UMG - stop all sequences playing

Hi there,

I've created a widget which is toggled on/off by pressing the i key - the widget has a button which launches a sequence player the first time it is pressed, and the second time it's pressed it skips to the end frame, and the player can then walk through the level... It works fine, but if the sequence starts playing, and then widget it then toggled off, then on again, a separate sequencer can be launched, which plays from the start, while the original one plays in the background. This can be done over and over, each time the widget is toggled off then on again.

Here is a screengrab of the BP:

alt text

Is it possible to set the play button in the widget to first stop any sequences that are currently playing, before creating a new one?

Cheers,

Nick

Product Version: UE 4.19
Tags:
widget.jpg (282.7 kB)
more ▼

asked May 27 '18 at 08:45 AM in Blueprint Scripting

avatar image

Knickers
21 4 8

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

3 answers: sort voted first

Aztecco - you are a certified genius!!! Thanks so much - promoting the widget to a variable worked a charm! Thank you so much!

If it helps anyone else, the widget BP ended up looking like this: alt text

And the level blueprint promoting it to a variable and using the I key to open/ close it looked like this: alt text

Thanks so much again for your help - I've learned lots by following your advice!

Cheers!

Nick

widget4.jpg (136.9 kB)
level-bp1.jpg (315.0 kB)
more ▼

answered May 28 '18 at 07:39 PM

avatar image

Knickers
21 4 8

avatar image AZTECCO May 28 '18 at 08:08 PM

Great job! And thank you so much i'm touched =)

So you gave the right answer! please mark your answer as correct and upvote my help also ;)

avatar image Knickers May 28 '18 at 08:33 PM

Done! Thanks once again - I really appreciate it!

avatar image AZTECCO May 28 '18 at 10:37 PM

Nice to help!

All the best and make great games!

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

Hello!

You may use a bool as a state and a branch instead of a multigate.. Don't forget to reset your state to 0 at animation end!

Hope it helps

more ▼

answered May 27 '18 at 12:19 PM

avatar image

AZTECCO
1k 17 8 15

avatar image Knickers May 27 '18 at 06:50 PM

Thanks for the tip - I (think) I've done what you suggested and it works well as long as the widget is open, but if it is closed and re-opened the variable is re-set and when the Play/ skip button is pressed, it begins playing a new sequence over the old one, so that there are two playing at the same time.

What I'd like to do is to click the Play/Skip button, close the widget when the sequence starts, then if the widget is opened again, clicking on the Play/Skip button will skip to the end of the sequence that was playing when the widget opened (I hope that makes sense).

Here is a screen grab of the updated blueprint: alt text

Thanks once again for the tip, and if anyone can help out further, I'd appreciate it.

Cheers,

Nick

widget2.jpg (175.4 kB)
avatar image AZTECCO May 27 '18 at 08:23 PM

Ok. You want your sequence to be persistent or something similar to a singleton, right?

So you can do a check if a sequence already exist, if not create a new one.

You can promote to var your sequence and check isvalid() or use another bool jus like isSequenceCreated

avatar image Knickers May 27 '18 at 09:10 PM

Thanks so much for getting back to me - I'll have a look at your suggestion tomorrow - I'm quite new to blueprints, so might have to do a bit of research... I will let you know how I get on.

Cheers,

Nick

avatar image Knickers May 28 '18 at 04:24 PM

Hi there, thanks once again for getting back to me - I've had a look at using the isvalid() check and it also works well, as long as the widget is open... The problem here is the same in that when the widget is closed and re-opened, all of the variables are reset and when I click on the Play/Skip button, it simply starts another sequence player over the top of the one that is already playing (and there is no way of stopping the original sequence)...

Here's a copy of my revised blueprint as it stands at the moment: alt text

As I said in my previous post, I'm quite new to Blueprints, and am sure I'm doing something wrong/ failing to understand something basic, but if someone could point me in the right direction, I'd really appreciate any help.

Cheers,

Nick

widget3.jpg (150.3 kB)
avatar image AZTECCO May 28 '18 at 06:15 PM

Can you show the code where you invoke the widget? Player controller?

Are you creating a new one every time you press i? If so a new one will be created.

You can create the widget and promote to variable so you can add or remove from parent every time you press i, or set visibility.. It should work!

Let me know

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

alt text This was my lazy solution. Count how long the sequence is, pause it

unknown.png (372.9 kB)
more ▼

answered Jul 22 '18 at 05:20 AM

avatar image

LastNickLeft
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