Configure Banter Scene Settings and Player Controls
The Banter JavaScript SDK exposes space-wide settings through BS.SceneSettings. Use these settings for occupancy, spawn position, clipping distance, target refresh rate, movement features, avatars, portals, guests, and physics behaviour.
Create one settings object after Banter and Unity have loaded, change the properties required by the space, then apply it to the scene.
- Get the
BanterScenesingleton after the SDK is ready. - Create
BS.SceneSettingsand set only the options the space needs. - Call
scene.SetSettings(settings)before enabling custom player or controller behaviour.
Apply SceneSettings
This compact example sets a spawn point, player limit, clipping planes, and several travel features:
const settings = new BS.SceneSettings();
settings.MaxOccupancy = 20;
settings.SpawnPoint = new BS.Vector4(0, 2, 0, 180);
settings.ClippingPlane = new BS.Vector2(0.02, 500);
settings.EnableTeleport = true;
settings.EnablePortals = true;
settings.EnableGuests = true;
settings.EnableAvatars = true;
scene.SetSettings(settings);
The SpawnPoint value stores the X, Y, and Z position in its first three values. Its fourth value is the player's Y rotation.
General Space Settings
The official Banter reference currently lists these frequently used settings:
| Setting | Purpose |
|---|---|
EnableDevTools |
Show the developer console. |
EnableTeleport |
Allow teleport movement. |
EnableForceGrab |
Allow objects to be grabbed at a distance. |
EnableSpiderMan |
Enable the wall-climbing ability. |
EnableHandHold |
Enable hand physics. |
EnableRadar |
Show the mini-map. |
EnableNametags |
Show player names. |
EnablePortals |
Permit portal travel. |
EnableGuests |
Allow guest users. |
EnableAvatars |
Display avatars. |
MaxOccupancy |
Set the maximum player count. |
RefreshRate |
Set the target frame rate. |
ClippingPlane |
Set the near and far camera clipping planes. |
SpawnPoint |
Set the spawn position and Y rotation. |
SettingsLocked prevents further setting changes after configuration. Apply the intended values before locking them.
Configure Movement and Physics
SceneSettings also exposes player-physics values for walking, acceleration, air control, jumping, hand behaviour, and grappling. Examples from the official API include:
PhysicsMoveSpeedPhysicsMoveAccelerationPhysicsAirControlSpeedPhysicsAirControlAccelerationPhysicsJumpStrengthPhysicsHandSpringinessPhysicsGrappleRangePhysicsGrappleReelSpeedPhysicsGorillaMode
The scene API can also change global gravity and time scale:
scene.Gravity(new BS.Vector3(0, -9.8, 0));
scene.TimeScale(1);
Use PhysicsSettingsLocked when the configured physics values should no longer change.
Enable or Disable Player Abilities
Banter exposes separate methods for movement, rotation, crouching, teleporting, grappling, jumping, and grabbing:
scene.SetCanMove(true);
scene.SetCanRotate(true);
scene.SetCanCrouch(true);
scene.SetCanTeleport(true);
scene.SetCanGrapple(false);
scene.SetCanJump(true);
scene.SetCanGrab(true);
These methods are useful when a game round, menu, seat, cutscene, or interaction temporarily changes what the local player can do.
Teleport, Forces, and Haptics
The scene can teleport a player to a position and Y rotation, apply a force to the player, change player speed mode, and send haptic feedback:
scene.TeleportTo(new BS.Vector3(0, 5, 0), 90, true, false);
scene.AddPlayerForce(
new BS.Vector3(0, 10, 0),
BS.ForceMode.Impulse
);
scene.SendHapticImpulse(0.5, 0.1, BS.HandSide.LEFT);
Check the official API reference for current parameter order and supported enum values before integrating these calls into a larger system.
Custom Controller Input
Banter can block individual thumbsticks, buttons, and triggers so a script can handle those inputs itself. When blocked, listen for:
button-pressedbutton-releasedcontroller-axis-updatetrigger-axis-update
Only block inputs your script actively replaces. Otherwise the player may lose the normal control without receiving an alternative.
Common Questions
Why does my Banter spawn point face the wrong direction?
The fourth value in SpawnPoint is the Y rotation. Check that value along with the X, Y, and Z position.
Why can players no longer move or use a controller input?
Check the SetCan... methods and every input-blocking setting changed by the script. Re-enable the ability or input when the custom interaction ends.
Official References
Related Navigation
- Banter JavaScript SDK Basics
- Banter Physics and Grabbable Objects
- Banter Multiplayer State and Events
- Banter VR Documentation