#anti crouch jump spam
1 messages · Page 1 of 1 (latest)
what is the difference between this and vanilla gmod?
i know gmod shifts the player's hitboxes up when they crouch jump, due to crouching pulling the bottom up
heres the code unless chen changed something before release
if crouchJumping then
local nextPos = mv:GetVelocity()
nextPos:Add(physenv.GetGravity())
nextPos:Mul(engine.TickInterval())
local plyPos = ply:GetPos()
local newPos = plyPos + nextPos
local _, sMaxs = ply:GetHull()
sMaxs.x = 0
sMaxs.y = 0
local cMins, cMaxs = ply:GetHullDuck()
local endPos = newPos - sMaxs
local hullTrace = util.TraceHull({
start = plyPos,
endpos = endPos,
mins = cMins,
maxs = cMaxs,
mask = MASK_PLAYERSOLID,
filter = ply
})
local trace = util.TraceLine({
start = plyPos,
endpos = endPos,
mask = MASK_PLAYERSOLID,
filter = ply
})
local total = Lerp((hullTrace.Fraction + trace.Fraction) * 0.5, 0, -cMaxs.z)
-- TODO: Does this hook run for other players?
ply:ManipulateBonePosition(0, Vector(0, 0, total))
end
yeah its p much just shifting the pelvis down depending on how far away from the floor it is when crouching midair
it would not have happened 2 years ago (when i made the script) tbh, mostly over the networking concerns
big limitation here is that bonemanips are not lagcomped, so crouchjump spam would likely still lead to bad hitreg
certainly could be worked around by doing all the manipulation work on the client... just that'll need me to see it act reliably with pvs and whatnot in mind
from what i can tell, your code should already be doing it clientside
since it's shared
oh that means you should set networking to false
forgot that that's on by default
it uses a hulltrace with playersolid so itd fuck up on client anyways for players that go over props
Not related but man your mods are awesome I love them