Search Unity

Animation - what am I missing

Discussion in 'Animation' started by Zace666, Mar 25, 2017.

  1. Zace666

    Zace666

    Joined:
    Jan 28, 2014
    Posts:
    21
    Sorry if I'm missing something obvious. I've searched but not found anything that solves my dilemma.

    I'm trying to create an animated menu - a simple rotation of the camera.
    I've created 4 animations, to go to and from the screens.
    I am trying to now add the camera to this animation so that I can rotate it, but in 5.6 it is not letting me add a property. The animator controlling this is attached to the camera.
    (I have read else where that there is a plus on the right ... i cannot see one)

    Now, I'm hoping I am missing something obvious - please feel free to point it out.

    Cheers
    Chris
     
  2. Zace666

    Zace666

    Joined:
    Jan 28, 2014
    Posts:
    21
    AnimationProblem.jpg This is what i have so far....
     
  3. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    Animations utilize the the hierarchy of the selected GameObject to animate properties of that object and it's descendants. You will not be able to arbitrarily add a camera to the animation if it does not exist as a child object of something you are animating.

    Based on the screen shot you posted, I'm guessing you selected the animation from the Project view, which will not allow anything to be added to a clip, you should be able to edit existing properties though. You will have to select the object with the animator controller to actually add new things to the clip. Also, keep in mind that the animation system uses string based paths to animated properties, so if the object that has the Animator doesn't have a child object that matches the full property path in the clip, it will fail to animate anything. For instance, if you try to animate "My_Cavas / Panel001 : GameObject.IsActive = true" in a clip, but the object with the animator doesn't have a child called "My_Canvas" the animation will not be able to do anything because it can't find the appropriate object.

    I'm not sure what exactly the effect is you are trying to do, but at first glance, I would say that you will need to look at how you've organized your hierarchy if you are going to be moving multiple UI Elements. Also, are you using World Space Canvases? Unless I'm mistaken, you won't be able to rotate a camera to face a canvas in any other mode.

    Hope that helps you out a bit.

    Cheers,
    TrickyHandz
     
    Zace666 likes this.
  4. Zace666

    Zace666

    Joined:
    Jan 28, 2014
    Posts:
    21
    Ahhh - so if i create an empty object and add all 3 canvases to it, will that work?
    Yes I am using world space
    :)
     
  5. Zace666

    Zace666

    Joined:
    Jan 28, 2014
    Posts:
    21
    and the idea was to rotate the camera to look at the different menu screens
     
  6. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    Yes, parenting your canvases to an empty GameObject will work. Then you will have access to all of the canvases and their child elements in the animation if you need it as well.
    Cheers,
    TrickyHandz