Example #1
0
    void CheckSaveSpecial()
    {
        if (mPhysics != null)
        {
            //Make sure it saves your position when you hit the floor, so you don't float
            if (mPhysics.IsGrounded(gameObject) && !mWasGrounded)
            {
                mWasGrounded = true;
                AddCurrentPosition();
            }

            //Save the position where you just get off the ground
            if (!mPhysics.IsGrounded(gameObject) && mWasGrounded)
            {
                mWasGrounded = false;
                AddCurrentPosition();
            }
        }
    }