client jump tree body logic
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-24 22:57:58 -04:00
parent 6eb53acbb3
commit 44ae9909ee

View File

@ -103,11 +103,13 @@ public class ClientJumpTree implements BehaviorTree {
}
//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();
}
if(currentFrame >= jumpFrames){
GravityUtils.clientAttemptActivateGravity(parent);
}