i have an character with some animations. They are mostly divided into two parts, like:
RunBase and RunTop
IdleBase and IdleTop
Its mainly for the purpose of changing the arm animation while running.
Now my problem: I want to blend or fade the animations into another. Here is my Code so far:
Crossfade is made to smooth from one to the other. The same way you are using it for the base, use it for the top. You'll need to have them on the same layer (instead of 10 and 11.)
CrossFade("A") automatically ramps up A, and ramps down the weight of whatever was on the same layer as A.
EDIT: (on response to questions entered as answers)
If you read the animation docs, the default settings are fine. So, you don't have to set weight=1, speed=1, blendMode=blend... . All you need to set is the layer, if not 0.
A lot of examples uselessly to set these, to show where you would be able to change speed to 50%, say.
CrossFade by itself really is made to solve the most common situation. Enable is for special circumstances (like you are going into a ragdoll.) The Ex from the docs really does work:
// these three animations are on the same level, and looping:
if(shooting) animation.CrossFade("upperGunAim");
else if(running) animation.CrossFade("upperArmPump");
else animation.CrossFade("upperIdle");
It also affects the animation.Crossfade (so that animation.CrossFade(“RunTop”) is just a CrossFade for the upper Body part?).
And by setting up different Layers for the “Top” Animations i can seperately control the weights in the upper and lower body half?
I have set the UpperBody Animations on Layer 1 and the Run / Idle Animation on Layer 0.
Is this how it should be done? (except the blendMode / weight settings)…
Because now i got another odd problem. The “DrawSwords” Animation is getting played when i press “e” - but only Once in the whole "GameSession. So if i press “e” again it seems like it is just playing the first frame of the animation.
Is there something wrong with my settings? The Animation works fine, ive already tried it in Loop Mode.