Exemple #1
0
    // if the mouse's planar position is not null, sends the point to the movement method of the TumbleBox
    void TryMoveCharacter()
    {
        Vector3 dir;

        if (MousePlanePosition(out dir))
        {
            dir -= character.transform.position;
            character.AddTorqueTowards(dir);
        }
    }
    void MoveBox()
    {
        float direction = -Input.GetAxis("Horizontal");

        character.AddTorqueTowards(direction);
    }