Well, it won't be realistic without some pretty advanced coding, but you can get away with some simple breathing by utilizing the Math functions, sine or cosine. Make a new character movieclip, make sure the registration point is at the bottom of your character (at the feet), give it an instance name of char
, and use this code on your Main Timeline frame (outside the movieclip):
var num = 0;
// change these to speed up/down AND change range/radius of breathing
var speed = 0.1;
var radius = 2.5;
var newHeight = char._height;
var originalHeight = char._height;
onEnterFrame = function(){
newHeight = originalHeight - (Math.sin(num)*radius);
num += speed;
}
function breathe(){
char._height = newHeight;
}
// this is to NOT make the breathing smooth, the lower the smoother
setInterval(breathe, 50);
Not the best solution in the world, but hey, at least it looks half decent.