Search Unity

.anim files and local axis. Need to animate local axis and NOT world axis. Please

Discussion in 'Animation' started by Shinugami, Feb 14, 2014.

  1. Shinugami

    Shinugami

    Joined:
    Oct 17, 2012
    Posts:
    54
    Hi,
    *Regarding Animation IN Unity using the Animation editor.
    I have an issue where I want to animate child objects of a parent object and more specifically animate their local position. The issue I am having is that if the object doesn't move, then there is no problem, the complex movement on a world axis can give the illusion of a local axis animation. HOWEVER if I want to animate on a local axis and this involves a moving object, the flaw in unity is revealed as the .anim only animates on a world axis. $UnitFailAxisExample.jpg


    *Been making games for about...20+ years but most of them were just personal hobbies but still of good standard.
     
    Last edited: Feb 17, 2014
  2. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    You're animating in Unity? Did you hit the button that toggles between World and Local space? (Top left hand corner of the Unity interface)
     
  3. Shinugami

    Shinugami

    Joined:
    Oct 17, 2012
    Posts:
    54
    Hi, thanks for the reply.

    Answers to Questions:
    1) yes I'm animating in Unity.

    2) Yes, Toggling the button only affects the movement in the editor and does not affect the axis that is animated by the .anim files.
    ----------------------
    Other details:

    Using Unity 4.3.4f1
    I have posted this in the suggestions area for Unity however I am hoping there is something I have missed. Otherwise I hope to make an issue out of this as it is CRUCIAL to game creation and over a year has passed and the same problem exists.

    It seems both Local and World axis toggles will create the same visual result in the editor however on the World axis.
    If the object does not move, there will be no issue. If the object moves then the issue becomes a problem because the animation does not animate on the local axis and it becomes very ugly. It makes a game look broken / unfinished / of poor quality. I have worked around the problem by reducing/removing effects that rely on this method however IF this method worked, the visual quality of my games would increase by a lot.

    I do have one example where the animation has kept to local axis however I cannot see an obvious explanation as to why it works with that game object and does not work with others. I have not been able to reproduce this result on other game objects.
    And that is why I am hoping there is something I have missed. I cannot get uniform results, every time I make an animation it seems like a roll of the dice as to whether it works. And except for 1 example, all my other attempts have not worked.

    Update: Yeah, just tested it again. One game seems to have a working example of a local axis animation and the other game wants to stay on world-axis. :(

    Update 2: Confirmed it again that it does not work. Tried different ways of animating that gameObject. (via menu and via editor(scene)) and also tried toggling the Global and Local axis button on/off and all methods failed.

    Update 3: In the game with the working example, tried the exact same method with a new object and it worked. So for some reason, one project file seems to allow animation in Local Axis and the other does not.

    Update 4: Exported the working animation/gameobject example into the project which has not been working. The animation is working on a local axis...progress I hope
    I'll keep trying to solve it. I will write that I have solved it if I do solve it. Until then consider it unsolved.

    I think in the meantime, unity should implement a note to say if the animation is in local or world axis. It would sure help with debugging. And until they fix this I could try a legacy animation on a 3D mesh.
     
    Last edited: Feb 17, 2014