jump tree conditional body logic

This commit is contained in:
austin 2025-05-24 22:57:37 -04:00
parent 3625123363
commit 6eb53acbb3

View File

@ -85,11 +85,13 @@ public class ServerJumpTree implements BehaviorTree {
this.setCurrentJumpForce(currentJumpForce * jumpFalloff);
//stop body falling if it is
DBody body = PhysicsEntityUtils.getDBody(parent);
DVector3C linearVelocity = body.getLinearVel();
body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2());
//push parent up
body.addForce(0, currentJumpForce, 0);
body.enable();
if(body != null){
DVector3C linearVelocity = body.getLinearVel();
body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2());
//push parent up
body.addForce(0, currentJumpForce, 0);
body.enable();
}
//potentially disable
if(currentFrame >= jumpFrames){
this.setState(JumpState.AWAITING_LAND);