> For the complete documentation index, see [llms.txt](https://docs.tebex.io/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tebex.io/developers/unity-engine/examples/show-a-qr-code-in-world-space.md).

# 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;
    }
}
```
