Animation bug or what?

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:


after left click:

if i left click the weapon changes it’s position and then it animates but didn’t go back

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

Please use code tags whenever you post code:

For the future, consider to post a little more information. Because with what you provided, it would be impossible to help or to even understand how you are doing the relevant stuff.

1 Like

forum posts, blogs and so on are not my world.
next time i’ll make it better