# Show a QR code in world space

**Generating a QR Code Texture for UI**

```csharp
using Tebex.QR;
using Tebex.TebexUnity;
using UnityEngine;
using UnityEngine.UI;

public class CheckoutQR : MonoBehaviour
{
    [SerializeField] RawImage qrDisplayImage;

    public void ShowCheckoutQR(string checkoutUrl)
    {
        // Encode the URL into a QR code (HTTPS only).
        QrCode qr = QrCode.Encode(checkoutUrl);

        // Convert to Texture2D with a scale of 8px per module and a 4-module quiet zone.
        Texture2D qrTexture = Utilities.QrToTexture(qr, scale: 8, quietZone: 4);

        // Assign to a RawImage UI element.
        qrDisplayImage.texture = qrTexture;
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/developers/unity-engine/examples/show-a-qr-code-in-world-space.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
