Example #1
0
    void Update()
    {
        Vector2 direction = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));

        if (direction != Vector2.zero)
        {
            direction *= 2;
            body.AddForce(new Vector2F(direction));
        }

        //commented this part because of the coroutine

        /*if (body.IsSleeping() || body.IsFixed())
         *  return;
         *
         * this.transform.position = body.InterpolatedPosition();
         */
    }