Players are unaffected by physobj:EnableGravity(boolean)/gravity not always enabled properly

I’m making a brush entity that is supposed to disable gravity when a player or physics prop enters it, but restore it when the entity leaves. It sort of works at the moment; it can disable gravity for physics props that enter it just fine, but it suffers from two major problems; it can’t disable gravity for players, and objects that leave it don’t always have their gravity reset properly.

For players, the brush can successfully grab the physics object and set its’ enable gravity flag (which I have confirmed using physobj:IsGravityEnabled()), but it has no effect. I’m not sure if this is a bug or user error, but I have trouble seeing what I could be doing wrong, especially seeing as it works just fine with physics props and similarly simulated physics objects (like npc_turret_floor).

As for the second issue, various print messages confirm that objects that leave the brush volume are triggering EndTouch and having their gravity set properly (again confirmed with physobj:IsGravityEnabled()). Despite the fact that IsGravityEnabled returns true, they don’t always return to their normal gravity bound behavior and will continue floating until EnableGravity is toggled again.

Are these bugs? I can’t seem to find much information on the use of these functions, but they seem self explanatory, and do sort of work as is. Am I missing something?

SetGravityEnabled only world on entities controlled by VPhysics. Players are controlled by CPhysics so it won’t work on them, you’ll need to do your own work around (adding the opposite force of gravity each tick or something similar).

Well that’s a nuisance. The fact that QPhysics objects (or CPhysics, my knowledge about this is vague and more generalized) are unaffected should probably be mentioned on the wiki page. I’m still not sure what to do about the second issue, though. I’ve considered toggling the entity after EndTouch multiple times, but the actual problem seems like it’ll just happen regardless, and I have no way of detecting if there even is a problem from the code (as physobj:IsGravityEnabled() returns true when the problem occurs, despite its’ continued lack of gravity).