Build a Camera-Facing Nameplate in Banter
BanterText renders 3D text, while BanterBillboard rotates its GameObject toward the camera. Combining them creates a label that remains oriented toward the viewer.
Create a positioned text GameObject, configure its readable text area, and add BanterBillboard with the required rotation axes.
- Create the nameplate GameObject above the object it identifies.
- Add
BanterTextwith colour, size, and alignment. - Add
BanterBillboardand select the axes that may rotate.
Create the Nameplate
const nameplate = new BS.GameObject({
name: "CameraFacingNameplate",
localPosition: new BS.Vector3(0, 2.2, 3)
});
Add 3D Text
nameplate.AddComponent(
new BS.BanterText({
text: "Creator Station",
color: new BS.Vector4(1, 1, 1, 1),
fontSize: 2,
horizontalAlignment:
BS.HorizontalAlignment.Center,
verticalAlignment:
BS.VerticalAlignment.Middle,
richText: true,
enableWordWrapping: true,
rectTransformSizeDelta:
new BS.Vector2(10, 2)
})
);
The text-box size gives wrapping and alignment defined boundaries.
Make the Nameplate Face the Camera
nameplate.AddComponent(
new BS.BanterBillboard({
smoothing: 0,
enableXAxis: true,
enableYAxis: true,
enableZAxis: false
})
);
The official reference defines smoothing: 0 as instant rotation. Each axis can be enabled or disabled separately.
Keep the Label Upright
Disable Z-axis rotation when the label should not roll:
enableXAxis: true,
enableYAxis: true,
enableZAxis: false
If the label should rotate only around the vertical axis, disable the X and Z axes:
enableXAxis: false,
enableYAxis: true,
enableZAxis: false
Parent the Label to Another Object
The GameObject constructor accepts a parent:
const nameplate = new BS.GameObject({
name: "ObjectNameplate",
parent: displayObject,
localPosition: new BS.Vector3(0, 1.2, 0)
});
The position is local to the parent supplied in the configuration.
Common Questions
Why does my Banter nameplate roll toward the camera?
Set enableZAxis to false when the billboard should not rotate around its Z axis.
Why does the Banter nameplate rotate immediately?
The official reference defines a smoothing value of 0 as instant rotation. Use a non-zero smoothing value when gradual rotation is required.
Official References
Related Navigation
- Banter Rendering, Geometry, and Materials
- Banter GameObjects and Hierarchies
- Banter Vector and Quaternion Math
- Banter VR Documentation