CVR Leg
Procedural leg used for spider/walker creatures and vehicles. The component spawns a Final IK CCDIK solver on the same GameObject, takes a chain of bones as input, drives foot placement via raycast, and applies holding force to a linked Rigidbody. Pairs with CVR Movement Driver for multi-leg creatures.
Setup properties
Section titled “Setup properties”Segments
Section titled “Segments”Ordered list of Transforms — the IK chain from hip to foot. Added to the CCDIK solver on Awake.
Has Foot
Section titled “Has Foot”When enabled, the last entry in Segments is treated as a foot and its rotation is re-aligned to the ground surface after IK runs.
Foot Thickness
Section titled “Foot Thickness”Offset applied along the foot’s up-axis so the IK target sits above the ground by this amount.
Layer Mask
Section titled “Layer Mask”LayerMask used by the step raycast. Typically “Default” plus the floor layers.
Linked Rigid Body
Section titled “Linked Rigid Body”Rigidbody the leg supports (and whose velocity it samples for step anticipation).
Force + stepping
Section titled “Force + stepping”Leg Force
Section titled “Leg Force”Maximum upward force applied to the linked Rigidbody when the leg is grounded and not stepping. Default 10000.
Step Area Offset
Section titled “Step Area Offset”Vector from the leg root to the ideal resting foot position (in local space). Used both as the support raycast direction and as the default foot location. Default Vector3.down.
Step Area Radius
Section titled “Step Area Radius”Radius around the step area center within which the foot may rest. If the IK target drifts outside this, a new step is triggered.
Step Speed
Section titled “Step Speed”Multiplier for step progress (higher = faster step animation). Default 5.
Step Height
Section titled “Step Height”Vertical apex of the step animation in meters. The step arc is multiplied by Y Offset.
Y Offset
Section titled “Y Offset”AnimationCurve sampled between 0 (start of step) and 1 (end of step); multiplied by Step Height to produce the arc of each step. The Awake override replaces the serialized curve with (0,0) (0.5,1) (1,0) by default.
Min Delay
Section titled “Min Delay”Minimum time between steps on this leg, in seconds. Default 0.2.
Foot Rotation Speed
Section titled “Foot Rotation Speed”Slerp speed for aligning the foot to the ground normal after each frame of IK. Default 10.
Speed Compensation Factor
Section titled “Speed Compensation Factor”Scales the linked Rigidbody’s velocity when choosing the next step target, so fast-moving legs plant ahead. Default 0.1.
Coordination with other legs
Section titled “Coordination with other legs”Opposit Side
Section titled “Opposit Side”A leg that should never step simultaneously with this one.
Neighbour A, Neighbour B
Section titled “Neighbour A, Neighbour B”Legs that also block stepping while they step.
Bipedal Mode
Section titled “Bipedal Mode”When enabled, also triggers a step if the IK target has drifted outside 25% of Step Area Radius from its target, giving humanoid legs a tighter gait.
External target mode
Section titled “External target mode”Use Target Location
Section titled “Use Target Location”When enabled, disables the automatic step system; the leg reads its IK target from Input Target Location instead.
Input Target Location
Section titled “Input Target Location”External transform used as the IK target when Use Target Location is on. Typically driven by an animation.
Output Target Location
Section titled “Output Target Location”Optional transform that mirrors the current IK target every frame, useful for tethering visual effects to the foot.
Public API
Section titled “Public API”| Member | Description |
|---|---|
isStepping | True while the step coroutine is active. |
ApplyForce(rb) | Called by CVR Movement Driver to apply the PID support force to the linked Rigidbody. |
UpdateIK(velocity) | Runs each FixedUpdate; determines whether a new step should be started. |
SetUseTargetLocation(bool) | Runtime toggle for Use Target Location. |
IsFootOnGround() | True when a step has finished and the foot is resting. |
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRLeg.cs