Lag Compensation #1217
kurozael
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What Is it?
Lag compensation happens server-side during
Simulate
and essentially rewinds lag compensated entities to the position they were in when the client being simulated sent their input commands. This means that traces will hit entities that the client would expect to be hit from their point-of-view.Enabling
If you want to enable it for any entities, such as a pawn, you can simply set the
LagCompensation
property to true on that entity. This is usually does in the entity'sSpawn
method.Traces
Within
Simulate
you can callUseLagCompensation()
on any trace to enable lag compensation for that trace and any subsequent traces until the end of the simulation.Example Usage
The following code could be used within a weapon's
PrimaryAttack
method. This is becausePrimaryAttack
is called withinSimulate
and so this trace would be lag compensated.Note: all subsequent traces will also be affected by lag compensation until the end of the simulation.
Beta Was this translation helpful? Give feedback.
All reactions