$origin: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Clarification)
(added note about not working in $includemodel is used)
Line 4: Line 4:


{{note|This command does not adjust positions of everything. It will adjust meshes, skeletons and [[$attachment]]s, but not anything else such as hitboxes ([[$hbox]]).}}
{{note|This command does not adjust positions of everything. It will adjust meshes, skeletons and [[$attachment]]s, but not anything else such as hitboxes ([[$hbox]]).}}
{{note|$origin does not work if the model uses [[$includemodel]].}}


== Syntax ==
== Syntax ==

Revision as of 13:29, 3 November 2021

The QC command $origin adjusts the position (and optionally Z rotation) of a model within its own local space. During compiling, it will be offset by the X, Y, -Z and Z-rotation values provided.

This is useful when adjusting view models, for ensuring that models don't spawn inside the world, and helping in the arranging of clusters of separate models that need to be aligned precisely with each other (e.g. parts of a building).

Note.pngNote:This command does not adjust positions of everything. It will adjust meshes, skeletons and $attachments, but not anything else such as hitboxes ($hbox).
Note.pngNote:$origin does not work if the model uses $includemodel.

Syntax

$origin <x> <y> <-z> [z rotation]

Note that Z's value is reversed.

With viewmodels

Cssorigins.GIF

See also