-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Hey everybody,
first of all thanks to @Phong13 for the awesome work!
I'm having trouble with a very simple test: I created Scene with BBox and added a Component that just adds an upward force as such:
public class Float : MonoBehaviour {
public Vector3 force;
BRigidBody rb;
void Start () {
rb = GetComponent<BRigidBody>();
}
private void FixedUpdate()
{
rb.AddForce(force);
Debug.Log("Unity: " + Time.frameCount);
Debug.Log("bphysics: " + BPhysicsWorld.Get().frameCount);
}
}
the force Vector is set to (0, 10, 0). Gravity in BulletPhysicsWorld is set to -9.81. The mass of the BBox is 1. I expected the box to slowly accelerate up, but it just drops to the floor.
The debug output tells me that both the Unity and the BPhysicsWorld provided frameCount do not increase by 1. Sometimes by 2, sometimes they don't increase. It is possible that I miss some frames? I'm clear on the fact that hovering this object can only work if the force is applied on every frame. As I increased the upward force, at some point there is some jerky movement of the box:
Please note that the same Script works as expected staying in the Unity PhysX World.
I didn't touch the Script Execution order or anything else. I'm using Unity 2018.2.5f1 Personal and BulletUnity from the Asset Store.