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
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.
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.
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.
How can you freeze/pause the animated menu when you hit Esc or fire menu Pause?
How can I call my Onload/Onstart on this last frame of my animated menu?
So I could activate my Hint button again?
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.
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.
I can send you the project so you could see it yourself if you want to.
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.
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.
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 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.
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.