# The drive loop: read held Input Triggers each tick and move the car prop.
StepCar(Agent : agent, Body : creative_prop)<suspends> : void =
Current : transform = Body.GetTransform()
var NextRot : rotation = Current.Rotation
if (SteerLeft.IsHeld[Agent]):
set NextRot = NextRot.ApplyWorldRotationZ(-0.06)
if (SteerRight.IsHeld[Agent]):
set NextRot = NextRot.ApplyWorldRotationZ(0.06)
var NextPos : vector3 = Current.Translation
if (Throttle.IsHeld[Agent]):
set NextPos = Current.Translation + NextRot.GetLocalForward() * 350.0
Body.MoveTo(NextPos, NextRot, 0.06)
Verse Library
verse
01 Fragment
Processes player input to update a car position and rotation each game tick.
verse-library/verse-car-drivable-capstone/01-fragment.verse