Forum rules - please read before posting.

Animated Menu bug

edited May 2015 in Engine development
When I switch between some levels my animated menu restarts playing its animation.
And switching between others doesn't restart and plays on.
 
I made an animated menu with AC Source and Graphic button in it with an hourglass sands animated texture and End on the last frame? checked. It plays an animation during the gameplay . It plays with no problem all the frames.

But when I switch between some levels it restarts the animation and plays from the start.
And some levels do not restart it, the animation plays on, and this is what I want, I don't want it to restart but play on till the last frame as it should be.

What gives?

I tried to compare the levels and tried to delete all my graphic gameobjects except the hotspots and interractions responsible for switching the levels, no messing around them just simple level swicthes. All OnStart's are by default, no other cutscenes.

The only thing I noticed is that when I switch to Game window of Unity (this is where you can see your menus without runnig your game) I can see a little blue rectangle of PlayerStart, this is only on those levels that restart my animated menu, in the others it is not visible in the game window. But PlayerStart is present in all levels in my project hierarchy and it is identical. Tried to copy and replace PlayerStart with no success.

What is happening?

Comments

  • edited May 2015
    The Game window will show the viewport of whatever your active camera is - generally the MainCamera, so if there's any difference in the view it could be that your MainCamera is in different places, but that shouldn't make a difference anyway.

    I never considered that someone might try to play an animated graphic across scenes like that.  How long is this animation, exactly?

    I shall see if this is something I can correct.  Please provide screenshots of your Menu (in the Game window) as well as a full view of your Menu's + Graphic element's properties.
  • edited May 2015
    Ok I think I solved it.

     The problem was in the GameEngine in Hierarchy. I copied/replaced the one that worked on some levels to the levels which didnt work. And now it plays continually without a hitch.
     
     However all GameEngine are perfectly identical to all others. I thoroughly checked them with screen caps. God knows why it works after the replacement.

     Could this be that the old levels were done with the previous AC version ? God knows.

    the animation is 31 frames long. It is a cooldown animation of hourglass for my hint system. I want the player to be able to see the cooldown progress accross all the levels so he knows when the hint will be available next.
  • edited May 2015
    Hmm, I thought the hint system wasn't going to be easy.

    How do I run an action or a cutscene that is still run across the levels?

    In my hint system I need cooldown 20 seconds progress to be carried over on switching levels. So I could activate my menu Hint button again and use it again.

    Though I managed to make my animated menu hint button to be carried over to other levels and have it continually played. I'm stuck with the cooldown, it doesn't carried over to other levels.

    Can we fire up an action or cutscene on End of last frame? in graphic elemet button menu? At the moment this doesn't exist there.


  • Also when you pause your game with Esc or hit menu Pause, the Graphic Element menu with Texture set as animated, which is in  my case an aimated texture of hourglass as hint, is not paused like any other object in the game ( be it a prticle system or an actionlist or sprite animation) but is restarted when you continue/unpause your game.

    How can you freeze/pause the animated menu when you hit Esc or fire menu Pause?
  • Since I can play animated menu through the levels with End on last frame? checked.
     How can I call my Onload/Onstart on this last frame of my animated menu?
    So I could activate my Hint button again?
  • Ok. I might solved this problem with DontDestroyOnLoad attached to my actionlist that is fired with my hint button. I'll need to test it more so there are no glitches before I put it to bed.
  • You can't carry Cutscenes / ActionLists over from one scene to the next, but the values of Global Variables will carry over: this post on how to create a timer might help you.  You could create another variable (a boolean) to determine whether or not the countdown asset should run when the scene begins.

    The pause menu is set to "Pause game when enabled?", which which literally freeze time and prevent animations from playing.  I will look to see if there's a way around this, however.
  • edited May 2015
    Yeah, I can carry Actionlists from scene to scene :)

    Your kit is really awesome, I suppose it is one of those things when you create something and then your discover that it does more than it was intend to.

     By prefabing it and giving it DontDestroyOnLoad and a constant ID. It works perfectly well. You can see how the actionlist is carried over to any level and still does whatever is in it, be it a game pause or object animation play.

    This could be very well implemented for lots of things, not only Hint system ,but for a health bar animated menu for example, or a score, time cooldown  etc.

     The whole thing is almost sorted out except the save/load issue. Right now I'm testing it, and it looks like when I save a level while I run an actionlist which includes an action with Wait till finish?  checked. It won't save it. And that goes not only to my Hint system but in general to any actionlist.

     For instance I have a sword cutting a rope in the actionlist when I click on the hotspot it does everything till it comes to an animation that has Wait till finish?  checked. If I try to save it while this action is run and load it, I could see it continued from where it froze everything, but the actionlist is not run after the animation, hence I still see the sword which is supposed to fade after the action that has Wait till finish?  checked.
     And that causes lots of problems for other actionlists which have Wait till finish?  checked or Engine: Pause Game in the game when you run them and try to save a game while they are ran.
    image

    I can send you the project so you could see it yourself if you want to.
     


  • edited May 2015
    Just tried that method with glbal variables that you linked.
    It doesn't carry over to other levels.
    And also do not save the state when you save/load. So if you save and laod during the action progress it won't continue.
  • edited May 2015
    Also I have fade in and fade out sprites looping OnStart, like glow effect for instance it works perfectly.
    But when I save and load it doesn't continue the progress after.
    It saves the last alpha value state of the sprite and shows only that e.g. frozen no fading in/out after.
    image

    This is frustrating since I have many fade in/out looping sequences where the game play depends on it. Some places in the game point out player what state his quest in. For instance if the crystals keep glowing then something needs to be done, if not then the task is complete and you can move on activate whatever is next or pick up an item.
     Having your game saved in a such a scene and load it will stop the fade in/out sequence and thus confuse a player.
  • You're opening a big can of worms by making ActionLists survive scenes, because there's more to it than that - and if you get problems with adapted AC code, then it becomes less possible for me to help you.

    You can't save mid-cutscenes, nor can you save the state of any actionlists that are running: and again, changing this would open a massive can of worms because there's just so many things that can go wrong.  This is the reason for the "Cutscene on load" field - you can use it to re-run any ActionLists that need to be, using variables to determine what should and shouldn't run.  It might be a cumbersome way of doing things, but it's the one way that ensures that things will at least work once you've set it up.
  • edited May 2015
    Ok, sounds like it is better to relaunch all those objects with fade in/out with Onload that first checks if the quest is completed by checking the present of some object.

    Chris, how about that Hint Cooldown timer with globals that you refered to here? I tried it and it doesn't carry over to over scenes nor it save/loads the state. Once you try to save the level, it won't count down the ticks when you load your level, it stops.

    Thanks for yur help.

  • Again: the timer cutscene won't be re-loaded when you save game or switch scene - you'll have to do that manually.  However, the global variable that you use to record the time value should be saved in both of those situations: if that's not happening, then there's a problem.  If so, you'll have to describe in detail exactly what you've done in relation to that.
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.