Roblox UtilitiesDevlHub Roblox Documentation

Class

AdPortal

Inherits
Instance › Object
Memory category
Instances

A portal that teleports players to a sponsored experience as part of immersive ads.

An AdPortal is an instance that must be parented to a Part — attempting to parent it elsewhere throws an error. When added to the data model, it registers itself with AdService to be served portal ads on rotation, and it uses a child AdGui to display the current ad's banner image and destination label above the portal.

When the local player's character touches the parent part, the portal teleports that player to the sponsored experience associated with the currently served ad. The portal only teleports while it is valid and has been served an ad with a destination place (see AdPortal.Status).

Properties 2#

PortalInvalidReasonstringA creator-facing message explaining why the portal is currently invalid, if it is.ReadSafeReadOnlyNotReplicatedNotScriptable
StatusAdUnitStatusIndicates whether the portal is currently active and able to teleport players.ReadSafeReadOnlyNotReplicated

PortalInvalidReason: string#

ReadOnlyNotReplicatedNotScriptableReadSafe

Holds a human-readable explanation of why the AdPortal is not in a valid, servable state. When the portal passes validation the value is an empty string; when validation fails it is populated with the specific reason reported by the portal's validator, such as an unsuitable parent or a misconfigured child AdGui.

This property is read-only and defaults to an empty string (""). It is intended for surfacing configuration problems to creators in Studio.

Status: AdUnitStatus#

ReadOnlyNotReplicatedReadSafe

Reports the portal's current AdUnitStatus. The value is AdUnitStatus.Active only when the portal has passed validation and has been served an ad with a valid destination place; in every other case it is AdUnitStatus.Inactive.

A newly created portal reports AdUnitStatus.Inactive, because its destination place is unset (0) until the ad service fills the portal with an ad — the portal cannot become AdUnitStatus.Active, and therefore cannot teleport, until that happens. This property is read-only.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed