Class PlayerMovement
Namespace: ValveResourceFormat.Renderer.Input
Assembly: Renderer.dll
Source engine-style FPS player movement controller with collision detection, gravity, and crouch support.
public class PlayerMovementInheritance
Constructors
PlayerMovement(UserInput)
Initializes a new bound to the given user input source.
public PlayerMovement(UserInput input)Parameters
input UserInput
The user input instance used to read key state.
Properties
AutoBunnyHop
Gets or sets a value indicating whether bunny-hopping is allowed by holding the jump key.
public bool AutoBunnyHop { get; set; }Property Value
BlendedEyeHeight
Gets the current eye height blended between standing and crouched positions.
public float BlendedEyeHeight { get; }Property Value
CrouchBlend
Linear value from 0 to 1 representing how much the player is crouched. 0 = standing, 1 = fully crouched.
public float CrouchBlend { get; }Property Value
EyePosition
The current eye position
public Vector3 EyePosition { get; }Property Value
Initialize
Gets or sets a value indicating whether the controller should reinitialize its position from the camera on the next tick.
public bool Initialize { get; set; }Property Value
OnGround
Gets a value indicating whether the player is currently on the ground.
public bool OnGround { get; }Property Value
Position
Gets the current player position at feet level (where the AABB touches the ground).
public Vector3 Position { get; }Property Value
RunSpeed
Gets or sets the base run speed in world units per second.
public float RunSpeed { get; set; }Property Value
TickRate
The desired update rate.
public int TickRate { get; set; }Property Value
Velocity
Gets the current player velocity in world units per second.
public Vector3 Velocity { get; }Property Value
WasOnGroundLastFrame
Gets a value indicating whether the player was touching the ground in the previous frame.
public bool WasOnGroundLastFrame { get; }Property Value
Methods
ProcessMovement(UserInput, Camera, float)
Main movement tick - processes input and updates position/velocity
public void ProcessMovement(UserInput input, Camera camera, float deltaTime)Parameters
input UserInput
camera Camera
deltaTime float
ResetPosition(Camera)
Reinitialize the character position from the current camera location. Call this when switching from noclip to FPS movement mode.
public void ResetPosition(Camera camera)Parameters
camera Camera

