> For the complete documentation index, see [llms.txt](https://brandsxgames.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brandsxgames.gitbook.io/documentation/unity/your-first-ad-surface.md).

# Your first ad surface

With the package installed and your project key set ([installation](/documentation/unity/installation.md)), adding a 2D surface is a matter of seconds. For 3D product placements, see [3D product placements](/documentation/unity/3d-placements.md).

## The fastest path: use a prefab

The package includes ready-made **AdFace** prefabs in a few aspect ratios. This is the quickest way in:

1. From the package's prefabs, drag an **AdFace** variant into your scene:
   * **AdFace** — general-purpose flat surface.
   * **AdFace 1\_1 Variant** — square (1:1).
   * **AdFace 2\_3 Variant** — portrait (2:3).
   * **AdFace 3\_2 Variant** — landscape (3:2). Pick the ratio matching the booked creative so it sits without distortion.
2. Position, rotate, and scale it in the scene like any other object until it's where you want the ad.
3. In the Inspector, find the **Ad Refresher Texture** component and set **Place Holder Id** to the slot we gave you (it defaults to `myfirstslot`).
4. Set a **Fallback Texture** (see below).
5. Press Play.

The surface fetches its currently booked creative and applies it to its material. That's the whole loop.

## Adding the component to your own object

If you'd rather put an ad on a mesh you already have:

1. Select the GameObject (it needs a **MeshRenderer**).
2. **Add Component → Ad Refresher Texture**.
3. Set **Place Holder Id** and **Fallback Texture**.
4. If the surface is one face of a multi-material or multi-mesh object, set **Material Index** to the slot the ad should use; for complex objects you can also assign a specific **Target Material** and **Ad Cast Collider** (see [Settings reference](/documentation/unity/settings-reference.md)).

At runtime the SDK applies the creative to the target material's texture. When you supply a target material, the SDK instances a copy at runtime rather than editing your shared material asset.

## Setting a fallback

Assign a **Fallback Texture** on the component before you ship. It's shown when there's no active campaign, the player is offline, or a load fails — so the surface always looks intentional, never blank. This is the one setting we recommend you never skip.

## Getting the forward direction right

A surface only counts as "seen" when the player is actually looking at its front. The component exposes an **Ad Face Forward** vector (default `Vector3.forward`) describing which way the surface faces. With the provided prefabs this is already correct. On your own mesh, if view-tracking seems off, enable debug output to see a line marking the forward direction in the Scene view and adjust **Ad Face Forward** (and **Unscaled Move Center Of Ad Offset** if the mesh pivot isn't centered).

## Repeat as needed

Every additional placement is the same: drag in (or add the component), position, set a slot. No per-placement scripting, no new code paths. See [Settings reference](/documentation/unity/settings-reference.md) for every option.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://brandsxgames.gitbook.io/documentation/unity/your-first-ad-surface.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.
