Thnx for the fast reply!
The location is different everytime, but that doesn’t matter because I use move, or otherwise the localTranslation + new translation.
The time does only change between the animations, the time needed for a animation to complete is always the same.
This is the animation I want to show (I know it’s some terrible coding):
[java]@Override
public void simpleUpdate(float tpf) {
if(time >= 0 && time < 2.5f) {
grabbingGear.move(0, -0.01f, 0);
hookRight.move(0, -0.01f, 0);
hookLeft.move(0, -0.01f, 0);
}
if(time >= 2.5f && time < 2.8f) {
hookRight.move(0, 0, 0.01f);
hookLeft.move(0, 0, -0.01f);
}
if(time >= 2.8f && time < 14) {
grabbingGear.move(0, 0.01f, 0);
hookRight.move(0, 0.01f, 0);
hookLeft.move(0, 0.01f, 0);
container.move(0, 0.01f, 0);
}
else if(time >= 14 && time < 53) {
grabbingGearHolder.move(0.01f, 0, 0);
grabbingGear.move(0.01f, 0, 0);
hookRight.move(0.01f, 0, 0);
hookLeft.move(0.01f, 0, 0);
container.move(0.01f, 0, 0);
}
else if(time >= 53 && time < 64.2f){
grabbingGear.move(0, -0.01f, 0);
hookRight.move(0, -0.01f, 0);
hookLeft.move(0, -0.01f, 0);
container.move(0, -0.01f, 0);
}
else if(time >= 64.2f && time < 64.5f) {
hookRight.move(0, 0, -0.01f);
hookLeft.move(0, 0, 0.01f);
}
else if(time >= 64.5f && time < 67) {
grabbingGear.move(0, 0.01f, 0);
hookRight.move(0, 0.01f, 0);
hookLeft.move(0, 0.01f, 0);
}
else if(time >= 67 && time < 75.2f) {
grabbingGear.move(0, 0.01f, 0);
hookRight.move(0, 0.01f, 0);
hookLeft.move(0, 0.01f, 0);
}
time += 0.01f;
}[/java]
I think this is what you mean:
[java]private void lowerGear(float time) {
float y = 10.9f / time; // distance divided through execute-time
if(200 < time) {
grabbingGear.move(0,-y,0);
hookRight.move(0,-y,0);
hookLeft.move(0,-y,0);
}
}[/java]
Is this the right way?
And how should I call these methods, because I don’t want to execute all methods at the start.