Banter SDK Enums and Constants Reference
The Banter JavaScript SDK groups component types, property names, layers, physics modes, controller values, rendering options, text alignment, collision modes, and joint constraints into named constants. Use these values instead of inventing strings or numeric IDs.
Pass the documented enum or constant expected by the method, keep the namespace visible in code, and check the official reference when adding a new component type or property.
- Identify the method or component field that needs an enum.
- Use the matching
BSnamespace and member. - Avoid replacing documented constants with guessed strings or layer numbers.
ComponentType: BS.CT
BS.CT is used with GetComponent():
const transform = obj.GetComponent(
BS.CT.Transform
);
const rigidbody = obj.GetComponent(
BS.CT.BanterRigidbody
);
The official reference includes collider, audio, GLTF, material, text, and light component types among others.
PropertyName: BS.PN
BS.PN identifies properties for watching or querying:
obj.WatchTransform(
[BS.PN.position, BS.PN.rotation],
handler
);
Documented examples include:
- position and local position
- rotation and local rotation
- Euler angles and local Euler angles
- local scale
- velocity and angular velocity
- text and font size
ForceMode
| Value | Documented behaviour |
|---|---|
BS.ForceMode.Force |
Continuous force affected by mass. |
BS.ForceMode.Impulse |
Instant force affected by mass. |
BS.ForceMode.VelocityChange |
Direct velocity change that ignores mass. |
BS.ForceMode.Acceleration |
Continuous acceleration that ignores mass. |
HandSide and ButtonType
BS.HandSide.LEFT
BS.HandSide.RIGHT
BS.ButtonType.TRIGGER
BS.ButtonType.GRIP
BS.ButtonType.PRIMARY
BS.ButtonType.SECONDARY
The official controller reference identifies primary as A/X and secondary as B/Y.
Banter Layers: BS.L
The SDK exposes named physics and rendering layers through BS.L. The official examples include user layers plus:
BS.L.NetworkPlayerBS.L.GrabbableBS.L.HandCollidersBS.L.PhysicsPlayer
Use named layers where the API provides them instead of embedding the numeric value in several scripts.
Material and Lighting Enums
Material sides:
BS.MaterialSide.Front
BS.MaterialSide.Back
BS.MaterialSide.Double
Light types:
BS.LightType.Directional
BS.LightType.Point
BS.LightType.Spot
Shadow modes:
BS.LightShadows.None
BS.LightShadows.Hard
BS.LightShadows.Soft
Text Alignment
Horizontal:
BS.HorizontalAlignment.Left
BS.HorizontalAlignment.Center
BS.HorizontalAlignment.Right
Vertical:
BS.VerticalAlignment.Top
BS.VerticalAlignment.Middle
BS.VerticalAlignment.Bottom
Collision Detection
The current API lists:
DiscreteContinuousContinuousDynamicContinuousSpeculative
through BS.CollisionDetectionMode.
Configurable Joint Motion
Each configurable-joint axis can use:
BS.ConfigurableJointMotion.Locked
BS.ConfigurableJointMotion.Limited
BS.ConfigurableJointMotion.Free
Geometry Types
BS.GeometryType includes box, circle, cone, cylinder, plane, ring, sphere, torus, torus knot, and parametric geometry values.
Common Questions
Why does GetComponent not find my Banter component?
Pass the matching component value from BS.CT rather than a guessed component-name string.
Should I use a numeric Banter layer directly?
Use the documented BS.L constant where one exists. This keeps the layer's purpose visible and avoids scattering numeric IDs through the code.
Official References
Related Navigation
- Banter GameObjects and Hierarchies
- Banter Controller Input and Haptics
- Banter Physics Joints
- Banter Rendering and Geometry
- Banter VR Documentation