Forum rules - please read before posting.

Trying to run animation sequence in background of scene

Hi everyone,
I have an electronic picture frame that I am trying to animate in the background of my scene and have yet to find the correct way to animate it. I have 9 animations in total that I'd like to play in a sequence: Fade into 1st picture, stay on 1st picture for 30 seconds, fade out 1st picture, fade into 2nd picture... etc. I have tried to do this by adding these animations to the png object file, which creates an animating controller with that name, then I create new cutscene and use the action list to form a sequence of playing the first animation, playing the second animation and waiting, then playing the third animation. Here is a picture of my Action List in the Inspector window.

I used the Object: Animate function, and have "Run in Background" checked. Lastly, I designated that cutscene as OnStart, since I want it to play from the beginning of the scene. I have tried this both with the picture frame as an Object and with it listed as an NPC. However, my animation never plays, and I have gotten other unwanted results such as the cursor not showing up, or the camera becoming locked. Any tips on the correct way to achieve this effect?

I am using Unity version 2019.3.13f1 and Adventure Creator v1.71.8.

Thanks!

Adam

Comments

  • Welcome to the @Adam_LM.

    Is this object supposed to be an NPC, or are you just looking for the best way to make this work?

    If you make an object an NPC, then AC will take control over animation duties in regular circumstances - so you should remove the NPC component if you have no need for them to e.g. talk or move around.

    If the animation is just supposed to play in the background at all times, there's not actually any need to involve AC. In Unity's Animator Controller, you can right-click on an animation clip to mark it as the default, and then Unity will play that when the game begins.

    You can then add transitions between your different animations to have one play after the other. This too, is all using Unity's animation workflow - check out Unity's own tutorials on animation if you're new to Unity as well as AC.

    The Animator Controller also lets you define parameters that can cause different transitions to occur based on their values. For background and scene objects, this is where AC is best used - because the Object: Animate Action can be used to change those parameter values. Just set the Action's Animation engine to either Sprites Unity Complex or Mecanim and you can enter in the details of the parameter you wish to change. It doesn't sound like that should be necessary in this situation, but it's good to know about for future reference.

  • Thanks for the reply! This info was very helpful for getting me better oriented. I have been able to get the correct loop with the method you described.

    I was previously unaware about which aspects of animation to control with the ActionList editor versus the Animation Controller. So is my understanding of the following now correct that: (1) any looped background animations can be handled within the Animator Controller (attached to the root object), (2) the Animator Controller sets rules about when to play certain animations (e.g., play when parameter = X), and (3) the logic in the AC ActionList editor is used mainly to change the parameters to let the Animator Controller know which animation to play?

  • edited July 2020

    That's correct, yes.

    With the "Sprites Unity" animation engine option, AC does also offer the ability to play animation clips by name - as in, entering in the name of the animation you want to play directly in the Action.

    However, the use of parameters to control transitions is more aligned with Unity "best practices" and is the recommended way of working when it comes to non-character objects.

  • I found this useful information. Thank you both.

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.