source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

[HL2MP] Fix trigger_push not lifting players off the ground

Open speedvoltage opened this issue 9 months ago • 2 comments

Issue: When a trigger_push is set to push players upwards, they often remain stuck to the ground and are not properly lifted when in motion (moving about). The original 1-unit Z-axis push is insufficient to "unglue" moving players from the floor.

Fix: Change the 1-unit Z push to 16. It might be overkill, but it at least ensures that players get pushed upwards when inside an active volume.

speedvoltage avatar Mar 14 '25 21:03 speedvoltage

This will breaks maps that expect the old behavior. I can remember maps which had a corridor where you could proceed ahead or optionally choose to jump to use the trigger push instead. If you want to force players off the ground there was already workarounds available (such as addoutput basevelocity)

ficool2 avatar Mar 14 '25 22:03 ficool2

~~I'd advise maybe adding a convar (that's off by default) that enables or disables this behavior~~

i.e

ConVar sv_trigger_push_useoriginfix("sv_trigger_push_useoriginfix", "0", FCVAR_NOTIFY);
...
if (sv_trigger_push_useoriginfix.GetBool())
{
	origin.z += 16.0f;
}
else
{
	origin.z += 1.0f;
}

EDIT: actually, make this a Keyfield so it can be used in Hammer.

bool m_bFixLift;
...
DEFINE_KEYFIELD(m_bFixLift, FIELD_BOOLEAN, "liftfix"),
...
if (m_bFixLift)
{
	origin.z += 16.0f;
}
else
{
	origin.z += 1.0f;
}

Bitl avatar Mar 16 '25 04:03 Bitl