Forum rules - please read before posting.

Skip cutscene doesn't follow through embedded asset file actionlists?

I have a UI transition in the On Start cutscene file:

And this runs this asset file:

However, if I skip the On Start cutscene, it repeats the transition asset file endlessly, unless I place this at the end of my On Start cutscene:
image
You'll notice it is a copy of the last action in the transition asset file. Is there a way of having AC also go through every action in embedded asset files?

Comments

  • edited November 2018
    It should do, and I can't recreate this.  At what point are you skipping OnStart - during or after the Actions in your asset file?

    AC and Unity versions too, and let's also see the properties of the Cutscene and ActionList asset.
  • If you still have the project file I sent you, it's in there if you fancy having a look. Sorry, slight mistake, it doesn't endlessly repeat, it just repeats the menu when the cutscene is skipped once. I believe the endless thing may have happened with a different set up. I'm skipping after the UI animation has played, which is odd as it definitely should have passed the embedded turn off menu action by that point. Here's a video: https://gfycat.com/AdmirableQueasyIberiannase

    AC 1.65.2
    Unity 2018.2.10f1

    Here are the properties of both cutscene and embedded actionlist:

    image
    image
  • edited November 2018
    This is not a bug, but an effect of the way that the skip system must work.

    When an ActionList (or sequence of ActionLists) is skipped, all Actions involved are re-run instantly - regardless of the point in which the sequence is run.  I won't go heavily into the details of why this is necessary, but chiefly it is to ensure that the state of the game is the same regardless of the point at which you skipped.

    When a Unity UI is turned on/off as a result of skipping, it does so instantly - at least, so far as AC is concerned.  If you rely on AC for your on/off transitions (Transition type: Custom Animation), then such transitions will be instant as well.

    Your menus, however, rely on their own animation playback which kick in automatically when the menus are turned on.  There's no relation between AC turning a menu on instantly, and your Animator - hence the animation plays in full.

    In cases like this, the answer is to end your ActionList with an Action that sets the animation to the correct "final" state.  You've already found this indirectly by turning off the Menu at the end of OnStart.

    More details on this aspect can be found in the Manual's "Skipping cutscenes" chapter.

    However, in this particular case, such a workaround is not necessary - and in fact it can be simplified to just one menu.  Create a Menu named "Overlay", and set its Transition type to Custom Animation - such that it's "on" animation shows the overlay and "off" animation removes it (basically merging your two existing menus into one).  With further "on instant" and "off instant" animations, you can have the animations play back instantly when skipping.  You can then turn this menu on whenever you want to show it, and turn it off again to show gameplay.

    For more on custom animations for UI menus, see the Manual's "Unity UI menus" chapter.
  • Excellent method, I've set this all up now, thanks! The only thing that would be nice is to have Overlay to disable completely when the animation is finished to save resources. I've animated in so that the image renderer child-object is disabled and enabled by the animator, but I can't obviously do this for the parent Overlay object with the Canvas, canvas scaler, graphic renderer and animator on. Can AC toggle such menus on and off when the animation is complete, without having to add the "wait 0.5 seconds" and "turn off menu" to disable the Overlay? Using a single menu in this means it's no longer possible to manually turn the menu off to save resources.

  • The performance impact of a single UI Canvas will be minimal - I wouldn't worry about the resources saving here, to be honest.

    If you rely on the auto-playing of transition animations, however, the Canvas will be turned off automatically after the Transition time (s) time is exceeded once the Menu has been called to turn off. See the Manual's "Unity UI menus" chapter - specficically, the "Custom Animation" option.

  • The other issue I noticed that in using a save menu, when the save menu is closed, the overlay menu plays the animation again... A nice effect, but unintentional! I imagine this would be because the menu is still enabled, although I may be wrong, does closing the save menu (retro saves) cause the scene to reload?

    I replaced everything as you described and I am using a single "turn on menu" onStart which automatically handles the overlay animation. Should I also have a close menu node in the action list? I have the transition speed set to 0, does the menu not close in this event?
  • the overlay menu plays the animation again

    You can try using the Menu: Change state Action in your Save menu's ActionList on turn off? to instantly turn the menu off.

    Should I also have a close menu node in the action list? I have the transition speed set to 0, does the menu not close in this event?

    It won't close unless you tell it to, and the transition speed should be set to match the duration of your animation.

  • Just to clarify, the two animations are a box wipe in, and a box wipe out; here you can see box wipe out plays as the scene exits, and the box wipe in plays as the scene begins:
    https://gfycat.com/RapidPessimisticFlatfish

    Using the single menu method, I'm not able to get boxwipeOut to play at any point, is this because I've set up the animator wrong?

    The boxwipeIn animation plays fine as long as I don't set the transition time to anything greater than 0, otherwise it doesn't play. Why would this be?

  • Assuming that your four animations are correctly set up, try making OffInstant the default.

  • Just to clarify a couple of points

    Should OffInstant be the default animation transition from entry? Just wanting to be totally clear on how this should be set-up and if there's anything I've missed at all? I'm still not sure how to get the box to close up to black if I turn off the menu.

  • this is definitely supposed to use a single menu to provide both the boxwipe out and boxwipe in

    Yes.

    turning the menu on should display this animation?

    Yes.

    turning on menu off should display this animation?

    Yes.

    offinstant should in this case be the image gameobject turned off and the box completely open?

    Yes.

    oninstant should be the box completely closed (a black screen) and the gameobject turned on?

    Yes.

    Should OffInstant be the default animation transition from entry?

    That's what I was suggesting, but you could also try an empty animation clip.

    I'm still not sure how to get the box to close up to black if I turn off the menu.

    Turning it off won't show black, it should remove the black overlay. Bear in mind that this is all just my suggestion - I haven't put it into practice.

  • It seems that:

    • the boxwipeIn only works because it's set as the default animation
    • turning on and off menus doesn't appear to work, it just gets stuck on the first frame of the animation
    • Setting the transition time just causes the menu to skip entirely to OnInstant, judging by the fact the sub-gameobject is disabled, as it would be if the animation completed or oninstant was called.
    • I tried running the animation manually using "menu turned on" and "menu turned off" actionlists, but the animation still gets stuck on frame 1.

    Sorry to be such a pain, it would be really nice to get these transition animations tidied up into a single, reusable menu that doesn't need sub-actionlists and actions at the end of each scene start and exit to ensure skipping works. On the plus side, I'm learning loads about how to use sprites complex from all of this! :D

  • There're too many unknown factors here to debug it. PM me a .unitypackage file of the Menu Manager, UI canvas prefab, Animator Controller and the 4 animation clips, and I'll see what's wrong.

  • Your menu had a non-zero Transition time (s) value, so I had to set this to a positive value.

    Your package also didn't include the menu's graphics, so I couldn't see exactly how the animations played out - however the intended animations are played correctly. "On" runs when the menu is turned on, "Off" with turned off, etc. From the AC side of things, it looks like this is all correct - your animations just need to be correct.

  • Ahh, okay I get it now, I need to tick "fade" to trigger the animation and "wait until finish" for scene exits in particular, that's excellent, thanks for being patient with me, this works a LOT better than before! :D

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.
Do NOT follow this link or you will be banned from the site!