如何使设置的线性速度不影响重力

如题
在使用摇杆控制玩家面向设置线性速度时 需要实时更新方向 并根据该方向设置速度
如何使设置的速度不影响重力

我也有类似的需求,请问具体怎么解决呢,可以帮忙讲解以吗,谢谢

let velocity: Vec3 = null;

    player.getComponent(RigidBody).getLinearVelocity(velocity);

    player.getComponent(RigidBody).setLinearVelocity(v3(x,velocity.y,z))