Develop

Turning

Updated: Sep 4, 2026
Turning rotates the player rig around its vertical axis. IWSDK supports snap and smooth turning through TurnSystem, which is owned by LocomotionSystem.

Choose a turning method

TurningMethod has two values:
TurningMethod.SnapTurn;
TurningMethod.SmoothTurn;
  • SnapTurn rotates by turningAngle degrees when the turn action crosses its activation state.
  • SmoothTurn rotates continuously at turningSpeed degrees per second while the turn axis is active.

Configure the initial method

The World locomotion option exposes turningMethod.
import { TurningMethod, World } from '@iwsdk/core';

const world = await World.create(container, {
  features: {
    locomotion: {
      turningMethod: TurningMethod.SnapTurn,
    },
  },
});

Tune angle and speed

Obtain the registered parent system and change its signals.
import { LocomotionSystem, TurningMethod } from '@iwsdk/core';

const locomotion = world.getSystem(LocomotionSystem)!;

locomotion.config.turningMethod.value = TurningMethod.SnapTurn;
locomotion.config.turningAngle.value = 30;

// To switch to smooth turning:
locomotion.config.turningMethod.value = TurningMethod.SmoothTurn;
locomotion.config.turningSpeed.value = 120;
turningAngle is degrees per snap. turningSpeed is degrees per second.

Input ownership

LocomotionSystem creates the action-based provider and injects it into TurnSystem. Do not register TurnSystem alone without a compatible inputProvider.
The standard path consumes the locomotion.turn action. Browser bindings are added when the World locomotion option sets browserControls: true.

Comfort guidance

  • Offer snap turning as the initial comfort-oriented mode.
  • Let the user select the snap angle or smooth-turn speed.
  • Avoid applying a second yaw transform to the camera while the locomotion system rotates world.player.
  • Test both modes in an immersive session.