Entity.SetPoseParameter

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:SetPoseParameter( String paramName, Float paramValue )
Description:
Sets the pose parameter of a model. Pose parameters control things in the model of the entity. For example, the floor turret has a parameter called "aim_yaw". Setting aim_yaw determines the direction the top of the turret faces.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetPoseParameter]Entity.SetPoseParameter [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionTaken from the scripted turret example, this sets the "aim_pitch" and "aim_yaw" parameters.
Used onNewerServer.png
Code
function ENT:Think()
    // Range is -60 to 60
    self:SetPoseParameter( "aim_yaw", math.sin( CurTime() ) * 60 )
    // -15 to 15
    self:SetPoseParameter( "aim_pitch", math.sin( CurTime() * 20 ) * 3 )
    // Shoot a bullet!
    self:DoBulletShoot()
    self:NextThink( CurTime() + 0.1 )
end
OutputN/A

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox