Class AimPunchServices
Namespace: ValveResourceFormat.Renderer.Gameplay
Assembly: Renderer.dll
Weapon recoil.
public sealed class AimPunchServicesInheritance
object ← AimPunchServices
Remarks
A shot does not move the punch angle directly. It pushes a velocity that decays exponentially, and the angle integrates that velocity while decaying back to zero both exponentially and linearly.
Fields
BulletScale
Scale from the punch to where bullets go.
public const float BulletScale = 2Field Value
float
ViewPunchScale
Share of each shot's kick that also goes into the view punch.
public const float ViewPunchScale = 0.055Field Value
float
ViewScale
Scale from the punch to the rendered view: 0.45 of the bullet offset.
public const float ViewScale = 0.9Field Value
float
ViewmodelScale
Scale from the punch to the first person weapon, which turns another 0.325 of the bullet offset past the view angles. Those already carry AimPunchServices.ViewScale.
public const float ViewmodelScale = 1.55Field Value
float
Properties
Punch
Gets the punch as (pitch, yaw) degrees. Negative pitch is up, as with Source angles. Scale by AimPunchServices.ViewScale, AimPunchServices.ViewmodelScale or AimPunchServices.BulletScale for use.
public Vector2 Punch { get; }Property Value
Methods
Kick(float, float)
Kicks the punch for one shot.
public Vector2 Kick(float angle, float magnitude)Parameters
angle float
Recoil angle from the weapon's recoil pattern, in degrees; 0 kicks straight up, positive to the right.
magnitude float
Recoil magnitude from the weapon's recoil pattern.
Returns
The view punch the shot adds, as (pitch, yaw) degrees.
Update(float)
Advances the punch by a frame.
public void Update(float deltaTime)Parameters
deltaTime float
Frame time in seconds.

