Garry's Mod Wiki



This class is essentially what controls a NextBot NPC. You can access it in a NextBot NPC by using self.loco variable.


CLuaLocomotion:Approach( Vector goal, number goalweight )
Sets the location we want to get to
Removes the stuck status from the bot
CLuaLocomotion:FaceTowards( Vector goal )
Sets the direction we want to face
number CLuaLocomotion:GetAcceleration()
Returns the acceleration speed
Vector CLuaLocomotion:GetCurrentAcceleration()
Returns the current acceleration as a vector
number CLuaLocomotion:GetDeathDropHeight()
Gets the height the bot is scared to fall from
number CLuaLocomotion:GetDeceleration()
Gets the deceleration speed
number CLuaLocomotion:GetGravity()
Returns the locomotion's gravity.
Vector CLuaLocomotion:GetGroundMotionVector()
Return unit vector in XY plane describing our direction of motion - even if we are currently not moving
number CLuaLocomotion:GetJumpHeight()
Gets the height of the bot's jump
number CLuaLocomotion:GetMaxJumpHeight()
Returns maximum jump height of this CLuaLocomotion.
number CLuaLocomotion:GetMaxYawRate()
Returns the max rate at which the NextBot can visually rotate.
NextBot CLuaLocomotion:GetNextBot()
Returns the NextBot this locomotion is associated with.
number CLuaLocomotion:GetStepHeight()
Gets the max height the bot can step up
Vector CLuaLocomotion:GetVelocity()
Returns the current movement velocity as a vector
boolean CLuaLocomotion:IsAreaTraversable( CNavArea area )
Returns whether this CLuaLocomotion can reach and/or traverse/move in given CNavArea.
boolean CLuaLocomotion:IsAttemptingToMove()
Returns true if we're trying to move.
boolean CLuaLocomotion:IsClimbingOrJumping()
Returns true of the locomotion engine is jumping or climbing
boolean CLuaLocomotion:IsOnGround()
Returns whether the nextbot this locomotion is attached to is on ground or not.
boolean CLuaLocomotion:IsStuck()
Returns true if we're stuck
boolean CLuaLocomotion:IsUsingLadder()
Returns whether or not the target in question is on a ladder or not.
Makes the bot jump. It must be on ground (Entity:IsOnGround) and its model must have ACT_JUMP activity.
CLuaLocomotion:JumpAcrossGap( Vector landingGoal, Vector landingForward )
Makes the bot jump across a gap. The bot must be on ground (Entity:IsOnGround) and its model must have ACT_JUMP activity.
CLuaLocomotion:SetAcceleration( number speed )
Sets the acceleration speed
CLuaLocomotion:SetDeathDropHeight( number height )
Sets the height the bot is scared to fall from.
CLuaLocomotion:SetDeceleration( number deceleration )
Sets the deceleration speed.
CLuaLocomotion:SetDesiredSpeed( number speed )
Sets movement speed.
CLuaLocomotion:SetGravity( number gravity )
Sets the locomotion's gravity. With values 0 or below, or even lower positive values, the nextbot will start to drift sideways, use CLuaLocomotion:SetVelocity to counteract this.
CLuaLocomotion:SetJumpHeight( number height )
Sets the height of the bot's jump
CLuaLocomotion:SetMaxYawRate( number yawRate )
Sets the max rate at which the NextBot can visually rotate. This will not affect moving or pathing.
CLuaLocomotion:SetStepHeight( number height )
Sets the max height the bot can step up
CLuaLocomotion:SetVelocity( Vector velocity )
Sets the current movement velocity

Special Pages



Render Time: 67ms

DB GetPage 42
Generate Html 4
SaveChanges (1) 9
Render Body 0
Render Sidebar 9