Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Animation bug or what?

Discussion in 'Animation' started by Transformator, Nov 30, 2014.

  1. Transformator

    Transformator

    Joined:
    Oct 1, 2013
    Posts:
    11
    code:

    #pragma strict

    var weapon : GameObject;

    function Update () {
    if (Input.GetMouseButtonDown(0)) {
    weapon.animation.Play("shoot");
    }
    }

    the animation is only moving the weapon a bit back and forward

    before left click:
    Screenshot (12).png
    after left click:
    Screenshot (13).png

    if i left click the weapon changes it's position and then it animates but didn't go back
     
  2. Transformator

    Transformator

    Joined:
    Oct 1, 2013
    Posts:
    11
    OHHH GOD SO EASY.

    about 4 minutes after i post this thread i get an idea i keyframe the positon in blender!
    its easy. I only have to create an empty and put the UMP in it. then i put the position from the ump to the empty and the animation witch i made on positon 0 0 0 and scale 1 1 1 and rotation 0 0 0 works on the position i need.
    I also have to change the animation a bit, i have to rotate the UMP in blender by 90°.

    LG
     
  3. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    theANMATOR2b likes this.
  4. Transformator

    Transformator

    Joined:
    Oct 1, 2013
    Posts:
    11
    forum posts, blogs and so on are not my world.
    next time i'll make it better