Search Unity

Camera animation?

Discussion in 'Editor & General Support' started by Thomas-Pasieka, Dec 27, 2006.

  1. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Hi there folks,

    I was wondering how I would set up a camera fly through? I have no idea on how to do that but I saw it in Tiki-Wiki-Golf (if I remember the name of the game correct. Could anybody help me with that?


    Thomas
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    There are various ways;

    * Use the built-in Unity animation tools to record keyframes (beware of that one - it's VERY hard to do for anything beyond the simplest things)

    * Code it - this is a bit annoying, though, but was what we did in gooball for most levels (we made a script which orbited the level and would end up at the ball starting point, pointing the right direction)

    * Make a path in a 3d app and import that into Unity, then parent the camera to that. We did that in gooball for the few levels where the circling didn't work well enough.
     
  3. Samantha

    Samantha

    Joined:
    Aug 31, 2005
    Posts:
    609
    I used method #1 that Nicholas described to animate the camera in Neko Factory. You can see it at http://www.nekofactory.com

    It's movement is 100% animation built within Unity. Took me about 5-6 hours from start to finish, and you can see it's a longer, more complicated move.
     
  4. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Thanks guys. Well I'd like to go for #3 but I guess I am not understanding it fully. Does UNITY recognize a spline path? Could you be a bit more specific on the steps involved Nic?

    Secondly, I would like to do it as described in #1 but as you and Ulognep said it's pretty timeconsuming and complicated. That leads me to one question....

    Will it be made easier in the next Unity update? Camera animation should actually be an easy task and shouldn't take hours to accomplish ;)


    Thomas
     
  5. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Basically, you set up an object to animate along a spline path (or using whatever method you prefer) in your 3D app. normally, I use an "empty", a "dummy" - basically just a transform with no mesh or anything. Just a transform that moves over time.

    Then you import this object into Unity. You will then have a game object that follows the transform path you set up.

    There are no immediate plans to improve animation paths... For most stuff, you want to do it in your 3D app anyways. Sure, it would be nice but there are just many items above it on the TODO list.
     
  6. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Even better Thomas is to parent your Camera in C4D (I assume that's what you're using for this) to the dummy object. That way you can "look" through the Camera in C4D and get the positions/rotations perfectly while animating the dummy. Then export that animation to Unity and parent the Unity camera to the animated empty object.
     
  7. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552