Skip to content

Class · inherits BaseWrap

WrapTarget

Official docs ↗

The WrapTarget object defines a target. A target is the 3D body with only an outer surface, or an Outer Cage.

About WrapTarget

The WrapTarget object defines a target. A target is the 3D body with only an outer surface, or an Outer Cage.

This target, often an Avatar, is what 3D accessories (using WrapLayer) will be applied to, allowing multiple accessories items to naturally layer over the source target.

Properties 2

  • Color: Color3NotReplicatedNotScriptableSets color used for the debug rendering. See WrapTarget.DebugMode.

    Sets color used for the debug rendering. See WrapTarget.DebugMode

  • DebugMode: WrapTargetDebugModeNotReplicatedNotScriptableAllows switching between different debugging visualization modes for cage meshes.

Methods 2

  • CreateTextureInCageSpaceAsync(texture: EditableImage, options: Dictionary?) → EditableImageYieldsCreates a new EditableImage in cage UV space from a texture in the parent MeshPart's UV space.

    Creates a new EditableImage by transferring texture from the UV space of this WrapTarget's parent MeshPart into the UV space of the WrapTarget's cage. This method yields until the transfer is complete and does not modify the input image.

    For example, after a player paints makeup onto a head mesh in an in-experience creation tool, use this method to transfer the texture into cage UV space before uploading it for use with WrapTextureTransfer. This method also supports cage-space texture transfers unrelated to makeup. To transfer a texture in the opposite direction, use WrapTarget.CreateTextureInTargetSpaceAsync.

    Use options to specify a region of cage UV space. Each supplied bound must be a finite Vector2. If both bounds are supplied, MaxUVBounds must be greater than MinUVBounds on both axes. Unrecognized option keys raise an error.

    This method requires the WrapTarget to be parented to a MeshPart with valid mesh and cage data. It raises an error if the input or options are invalid, required mesh data cannot be loaded, or the transfer fails. If the device-specific editable memory budget is exhausted, it returns nil. See EditableImage for additional usage requirements.

  • CreateTextureInTargetSpaceAsync(texture: EditableImage, wrapTextureTransfer: WrapTextureTransfer) → EditableImageYieldsCreates a new EditableImage in the parent MeshPart's UV space from a texture in cage UV space.

    Creates a new EditableImage by transferring texture from cage UV space into the UV space of this WrapTarget's parent MeshPart. This method yields until the transfer is complete and does not modify the input image.

    The wrapTextureTransfer supplies the optional reference cage through WrapTextureTransfer.ReferenceCageMeshContent and the cage UV bounds through WrapTextureTransfer.UVMinBound and WrapTextureTransfer.UVMaxBound. Use a WrapTextureTransfer under a Decal on the same MeshPart as the WrapTarget.

    For example, use this method to transfer a makeup texture you own into a head mesh's UV space so players can edit it directly on the head in an in-experience creation tool. This method also supports target-space texture transfers unrelated to makeup. To transfer the edited texture back into cage UV space, use WrapTarget.CreateTextureInCageSpaceAsync.

    This method requires the WrapTarget to be parented to a MeshPart with valid mesh and cage data. It raises an error if either input is invalid, required mesh data cannot be loaded, or the transfer fails. If the device-specific editable memory budget is exhausted, it returns nil. See EditableImage for additional usage requirements.

WrapTarget also has every member of BaseWrap. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.