Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Camera Animation won't start but is shown as active

Discussion in 'Animation' started by Apfelbox, May 14, 2014.

  1. Apfelbox


    Apr 28, 2014
    Hey, I hope the title was somehow understandable. I'm new to Unity and very new to Unity Animations. I tried to create an animation for my camera, that resets the position.
    In my AnimatorTab are 3 states at the moment:
    "idle" - does nothing (default)
    "any state" - that state was there from the beginning
    "resetCam" - this state has a motion to reset the cam

    I made a transition between "any state" and "resetCam" with the condition of the parameter (bool) "resetCam" to be true. For testing purposes I use the following code:
    Code (csharp):
    1. if(Input.GetKeyDown(KeyCode.W)){
    2.             resetCam.SetBool("resetCam", false);
    3.         }
    4. if(Input.GetKeyDown(KeyCode.S)){
    5.             resetCam.SetBool("resetCam", true);
    6.         }
    I've got no compiling errors. When I hit start the idle animation is playing and when I press "s" the transition from "any state" to "resetCam" starts. So when I look at the Animator tab everything looks fine but in the scene tab nothing is happening.

    I hope my problem is understandable. Thanks for taking the time reading my post.
    - apfelbox