Source Academy Modules
    Preparing search index...

    Function instantiate_sprite

    • Creates a new 2D Sprite GameObject from an online image.

      The Sprite GameObject has a BoxCollider2D that matches its size by default. You may use remove_collider_components function to remove the default collider.

      Note that Unity Academy will use a HTTP GET request to download the image, which means that the HTTP response from the URL must allows CORS.

      2D mode only

      Parameters

      • sourceImageUrl: string

        The image url for the sprite.

      Returns GameObjectIdentifier

      the identifier of the newly created GameObject