From Valve Developer Community
Revision as of 18:03, 22 October 2017 by Crazybubba64 (talk | contribs) (Significant re-write of the page. New example code with inline comments. Completely re-worked explanation of the syntax so it is compatible with modern studiomdl.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Creates a channel to manually set a single axis position or angle on a bone through game code. Not recommended for use, as this functionality was succeeded by $poseparameter and $sequence.

Warning.png Warning: You can't assign more than 6 controllers to a single bone.


$controller <number> "<bone_name>" [L]<axis>[R] <start> <end>


The number of the controller (you may need multiple controllers). 0-3 for custom controller, 4 or "mouth" for jaw (GoldSrc only).
The name of the bone to control.
The prefix 'L' specifies that the controller is to loop the bone movement from the <end> to the <start>.
Warning.png Warning: GoldSrc only.
The axis can be either X, Y, or Z. You need to specify a new controller for each axis of movement/rotation.
The suffix 'R' specifies that the bone is to be rotated from <start> degrees to <end> degrees. Not including 'R' simply moves the bone along the <axis> from <start> world units to <end> world units.
Starting value of the controller.
End value of the controller.


$modelname "WScanner_Single.mdl"
$model "WScanner" "WScanner_Single_Waste_Scanner_Reference.smd"
$cdmaterials "models\obsolete\waste_scanner\"
//This controller rotates the root bone from 0 to 360 degrees.
$controller 0 "Dummy (Root)" ZR 0 360
//Controller 1 has two entries to allow for the bone to travel 17 units in the X(-Z) direction.
//$controller lines can only have one direction specified, so this allows for blending the movement.
//move the antenna base bone from 0 to 17 units in the X direction.
$controller 1 "Antenna Base" X 0 17
//move the antenna base bone from 0 to -17 units in the Z direction.
$controller 1 "Antenna Base" Z 0 -17