This example studio project demonstrates how to build multiple player controllers, switch between them dynamically, and integrate physics-driven gameplay with smooth camera tracking.
- Install the Desktop App
- On this repository, click Code > Download zip
- Unzip the folder to the location you'd like to work in
- In the desktop app, click "Open" and select the folder
- Recommended: Track your files using git to avoid losing progress
Please raise any questions on Github Discussions or join the Discord to connect with the community.
Players can swap between two vehicles:
- Beach Ball - a rolling ball with classic movement and jump mechanics.
- Rocket - a thrust-based vehicle with tilt, stabilization, and directional boosters.
- WASD / Arrow Keys - Movement
- Space - Jump (Ball) / Thrust (Rocket)
- Shift - Stabilize (Rocket)
- UI Buttons - Switch between Beach Ball and Rocket
The vehicleSwap component manages switching between the ball and rocket controllers. It updates active states, swaps models, and dispatches global events so systems stay in sync.
Schema:
- rocketButton: UI element for selecting the rocket
- beachBallButton: UI element for selecting the ball
- rocketModel: Asset path for rocket model
- beachBallModel: Asset path for beach ball model
State Machine:
- ballActive: Ball model is shown, ball controller enabled
- rocketActive: Rocket model is shown, rocket controller enabled
The ballController enables rolling physics and jump mechanics. It supports both direct movement and torque-based control for variety.
Schema:
- force: Movement force applied per input
- jumpForce: Impulse force applied when jumping
- jumpControlFactor: Air control multiplier
- torqueForce: Additional torque applied when modifier is held
Data:
- isGrounded: True if in contact with surface
- collisionCount: Number of active collisions
- velocityX / velocityZ: Tracked movement speed
- isActive: Whether the ball controller is currently active
The rocketController simulates thrust-based flight and tilt controls with optional stabilization. Particle systems toggle with thrust input for visual feedback.
Schema:
- torqueStrength: Rotation force applied by tilt input
- mainThrustForce: Upward lift from main booster
- lateralThrustForce: Side thrust for precision movement
- rotationDamping: Dampens angular velocity for stability
- maxTiltAngle: Tilt limit in radians
Data:
- isGrounded: True if rocket is touching ground
- collisionCount: Active collisions count
- velocityX / velocityZ: Horizontal speed tracking
- isThrusting: Whether thrust is active
- isActive: Whether rocket controller is active
- quaternion (x,y,z,w): Stores current rotation
The Input Manager maps multiple input methods into unified actions:
- forward — W / Up arrow / gamepad stick up
- backward — S / Down arrow / gamepad stick down
- left — A / Left arrow / gamepad stick left
- right — D / Right arrow / gamepad stick right
- jump — Space bar
- modify — Shift (used for rocket stabilization and ball torque mode)
Pirate Kit By Quaternius, Pirate Kit By Kenney, Chest Game Asset Animated By Johnny Rogue
