Hello I have an entity which is a soldier. I use Graphiclist for it’s Graphic. When soldier stands he is breathing (this is 1st layer of his animation), so his hands are moving up and down. Second layer of soldier’s graphic is a gun which I want move up and down to follow soldier’s hands. This is an array of gun’s y-offset values for “stand” animation:
private static const gun_offset_y_frames:Array =
[0, -1, 0, 1];
This is a part of update() function where I’m trying to move gun to follow soldier’s hands:
grp_gun.y = gun_base_y + gun_offset_y_frames[grp_anim.frame];
But gun changing it’s position in the next frame, so I can’t achieve full syncronization, and gun is like flying near soldier. Please tell me what is my mistake? Should I choose another place (event/function) to move gun?
Sorry for my english… I hope my question is understandable.