Skip to content

FixedUpdate not called in every frame #49

@fi4sk0

Description

@fi4sk0

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:

https://youtu.be/tf4bAij0SAE

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions