Fixing trigger gravity

From Valve Developer Community
Revision as of 05:23, 5 January 2018 by Nullspeak (talk | contribs) (Created page with "Currently the trigger_gravity brush entity doesn't actually function properly. To fix gravity triggers, navigate to triggers.cpp, around line 2679 and fin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Currently the trigger_gravity brush entity doesn't actually function properly.

To fix gravity triggers, navigate to triggers.cpp, around line 2679 and find this:

void CTriggerGravity::GravityTouch( CBaseEntity *pOther )
{
	// Only save on clients
	if ( !pOther->IsPlayer() )
		return;

	pOther->SetGravity( GetGravity() );
}

and either comment out or remove the if-return.

trigger_gravity should work fine now on players, but still won't change a physics object's gravity.