Ninja Model Walks backwards

Hi Guys,



I have a mysterious problem. When i run my program. The ninja.j3o model moves in a backwards animation (like a moon walk) . When I run it in another simpler program, it walks normally.



This is the code:



public void simpleUpdate(float tpf) {

if (left) {

walkDirection.addLocal(camLeft.add(camLeft));

}

if (right) {

walkDirection.addLocal(camLeft.negate().add(camLeft.negate()));

}

if (up) {

walkDirection.addLocal(camDir.add(camDir).add(camDir));

}

if (down) {

walkDirection.addLocal(camDir.negate().add(camDir.negate()));

}

if (!character.onGround()) {

airTime = airTime + tpf;

} else {

airTime = 0;

}

if (walkDirection.length() == 0) {

if (!“Idle2”.equals(animationChannel.getAnimationName())) {

animationChannel.setAnim(“Idle2”, 1f);

}

} else {

character.setViewDirection(walkDirection);

if (airTime > .3f) {

if (!“Idle2”.equals(animationChannel.getAnimationName())) {

animationChannel.setAnim(“Idle2”);

}

} else if (!“Walk”.equals(animationChannel.getAnimationName())) {

animationChannel.setAnim(“Walk”, 0.5f);

}

}

character.setWalkDirection(walkDirection);

}





Please help! Thanks

Ok, I understood. for some reason. i have to negate the character direction. Thanks :slight_smile:

I think the ninja looks in -z direction, he’s a bit queer anyway ^^

1 Like

I personally would stick with the moon-walking ninja. :slight_smile:

1 Like

I would for sure play a moon-walking ninja game!

1 Like