Here’s the situation… I have created a character in Blender, and she has 6 animations: Stand, Walk, Run, Jump, Land (from a jump), and Bored.
Now, I’ve been playing around with the Javascript code for making the character move when she’s supposed to, and it looks half-decent, but it’s definitely buggy. The problem is that I can’t figure out the proper times to use CrossFade, CrossFadeQueued, Blend, PlayQueued… it’s getting beyond me.
So, I’ve written out what I think I want the character to do in fake “pseudo-code”. Anyone have advice?
if (character is standing still) {
if (character has not jumped or walked anywhere for 7 seconds) {
fade 0.3 secs into the BORED animation;
}
} else {
if (character is jumping) {
fade 0.3 secs into the JUMPING animation;
}
if (character is on the ground) {
if (character was in the air and has contacted the ground this frame) {
if (character is moving at running speed) {
fade 0.3 secs into the RUNNING animation;
} else if (character is moving at walking speed) {
immediately play the LANDING animation, but fade 0.3 secs into the WALKING animation;
} else {
immediately play the LANDING animation;
when landing animation is finished, play the STANDING animation;
}
} else {
if (character is moving at running speed) {
fade 0.3 secs into the RUNNING animation;
} else if (character is moving at walking speed) {
fade 0.3 secs into the WALKING animation;
}
}
}
}