Hi Chris (or anyone else in case they know how to solve this). I'm having some trouble with an 8 frame pretty simple black box transition. I've made an AC Menu, set an ActionList when it turns on that plays the Sprites Unity animation, but can't get it to work when turning on the Menu.
I can get it to play fine when it's just a GameObject in the scene, playing its default animation. If I bring the GameObject with the animation controller into the scene, or if I bring the Prefab into the scene, it works.
I've made a Prefab of the GameObject that has the animator on it, and its ConstantID is set to 'Retain in Prefab'. So, the scene-independent ActionList is managing to reference the AnimationController from the Prefab, but I can't seem to get it to play when calling the Menu if the GameObject isn't in the scene. I can see the object being temporarily brought into the scene in the Heirarchy and then destroyed, so maybe it's happening off-screen? Can't seem to figure it out. And wondering please what's best practices to bring in a simple frame animation for a transition from any scene - as a menu, or otherwise?
Thanks.



It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The Animator object will need to be present in the scene for it to take effect.
It'll either need to be present in the Hierarchy by default, or you can use the Object: Add or remove Action to spawn it in, animate, and then remove it afterwards. If your ActionList has a GameObject parameter, the "Add" Action can assign this as the spawned object, allowing you to reference that as the object to delete in the "Remove" Action.
Thanks Chris - that does work. However, the issue I'm having now is that the camera needs to be centred at 0,0 for the effect to work, otherwise it's off-center or off-screen. I was hoping by using a Menu it would be more like a UI, independent of the camera's position, ie kind of render over everything and not depend on where the camera's current position is.
I tried finding a way to use an Action to parent the spawned in Block prefab to the Main Camera before it plays, or to teleport it to the same X and Y co-ordinate of the scene's Main Camera with an 'Object: Teleport' action, but no luck so far with that.
EDIT: I created a new Marker2D and parented it to the camera, and used an 'Object: Teleport' action to teleport the spawned in prefab to that marker. Need to test more, and while a bit hacky, I'm kind of amazed it seems to work.
**
I also don't think this needs to even be a Menu, can just be an ActionList**
I've got something else working that I adapted from your black bars preset, a Custom Animation Blend thing with a linked Unity Prefab that has a RectTransform boundary etc... so I could adapt that some more, but I'm hoping there's a simpler way to get an ACMenu to work.
Ah yeh, darn, I couldn't find a good way to change the Parameter of the 'Camera Marker' in different scenes while calling the ActionList.
Might just stick with the adapted Cutscene Bars transition.
Chris: Unless there's a good way to consistently make sure the spawned prefab animation transition shares the same Transform position as whatever scene's Main Camera it's being called in? I'd really like to be able to use my png animation across scenes if poss!
Ok, so after a lot of fiddling, while I liked the adapted Custom Animation Blend from the Cutscene Black Bars preset, I was having trouble having to turn it on before I could turn it off.
In the end I made a simple Unity Canvas with a Panel and an Image, set the Canvas to 'Screen Space - Camera' so it appears as it should no matter what the camera's doing, set the Panel and Image to 'Stretch' in its RectTransform, put an Animation Component on the image and added the Animation Controller, made it a Prefab, made some ActionLists for it where it creates the Object (like Chris suggests), plays a custom simple animation, and destroys it, and now I can run them in different scenes.
It's fairly straightforward lol.
Not sure if this'll be interesting to anyone but yeh, did away with the Menus and I just run an ActionList from inside another ActionList when I want one of the 3 types of transition animations to run.
I replayed 'Sam & Max: Hit the Road' recently (my fav game) and it uses a transition similar to this, wanted to recreate it.