Пример #1
0
        private void OnCollisionEnter2D(Collision2D collision)
        {
            if (collision.collider.CompareTag("Player") && !startMoving)
            {
                PlayerCharacter player = collision.collider.GetComponent <PlayerCharacter>();
                // PlayerCharacterOld player = collision.collider.GetComponent<PlayerCharacterOld>();

                // Make sure the object doesn't take off without the player on board!
                if (player.IsTouchingGround())
                {
                    startMoving = true;
                }
            }
        }