garrysmod-issues
garrysmod-issues copied to clipboard
Entity.SetFriction has no effect for players
Currently Entity.SetFriction sets the keyvalue "m_flFriction" which is great for props or other entities that rely on this keyvalue. It has no effect on players.
Player friction is set in engine via pEnt->SetFriction( float multiplier ) instead. Adding a IsPlayer() check for this would solve it.
Bonus points if you add/un-ifdef the func_friction/CFrictionModifier entity back in!
Get/SetFriction would have to be shared for players and network any updates to the client since player movement is done shared. Other than that, adding friction support to player movement is pretty easy - GetFriction just has to be factored into these lines:
- https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/shared/gamemovement.cpp#L1426
- https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/shared/gamemovement.cpp#L1630
- https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/shared/gamemovement.cpp#L2225
- https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/shared/gamemovement.cpp#L2304
bump this would be useful for many players including myself looks easy to implement too
This has been an issue for too long. Please fix. I would like to be able to set the friction of players when they are shot by a gun, but it is currently not possible. This would make for a great equipment item in TTT for traitors to slow down people. @svdm
SetFriction
now affects player movement, as a multiplier of sv_friction
convar's value, in range of [0,10].
Thanks I got engaged and bought a house and divorced and moved continents and moved back and did it again but it was worth it