Skip to content

CVR Movement Driver

Drives a Rigidbody body as a legged creature or hover vehicle. It combines a set of CVR Leg components with forward/backward/strafe speed targets, and steers via torque around the local up axis. If a CVR Seat with locked controls is found underneath, the seated player’s input is read automatically.

A Rigidbody is required on the same GameObject ([RequireComponent]).

List of CVR Legs that receive ApplyForce each physics tick. Each leg raycasts downward and adds a PID-controlled holding force to the driver’s Rigidbody.

Maximum forward speed in m/s. Default 10.

Maximum backward speed in m/s. Default 10.

Maximum strafing (local X) speed in m/s. Default 10.

Seconds to ramp from zero to the applicable max speed. Default 2.

Seconds to ramp back to zero after input is released. Default 1.

Torque factor around the local up axis per unit of steering input. Default 100.

Forward/back input in the range [-1, 1]. Negative values engage backward speed.

Steering input in the range [-1, 1], mapped directly to torque.

Sideways input in the range [-1, 1].

When enabled and a CVR Seat with locked controls is occupied by the local player, the component reads driving input from CVRInputManager:

  • Input Accelerate = accelerate - brake
  • Input Steering = steering
  • Input Strafe = lookVector.x in VR, Q/E on desktop

Each FixedUpdate:

  1. Samples the Rigidbody velocity in local space.
  2. Calls ApplyForce on every leg, letting each leg add its holding force.
  3. For each axis (forward/strafe) uses one of two PID controllers (Ac for acceleration, Br for braking) to produce a force from the difference between the target and current speed. The controllers are clamped to [-10, 10].
  4. Adds the resulting force (in world space) and a steering torque around transform.up.
  • CVR-GameFiles/ABI.CCK.Components/CVRMovementDriver.cs