Exemplo n.º 1
0
    private void UpdatePhysics()
    {
        DevMath.Vector2 forceDirection = new DevMath.Vector2(-Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
        rigidbody.AddForce(forceDirection, Time.deltaTime);

        Position += rigidbody.Velocity;
    }
Exemplo n.º 2
0
    private void UpdatePhysics()
    {
        DevMath.Vector2 forceDirection = new DevMath.Vector2(-Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));

        rigidbody.AddForce(forceDirection.Normalized, Time.deltaTime);

        Position += rigidbody.Velocity /** Time.deltaTime*/; // Velocity is in meter per seconde, dus moet je het nog keer deltaTime doen.
    }