• Speed changes when going backwards?
    4 replies, posted
On my deathrun server, when you move forward the speed is normal but when you move backwards its like you are walking (really slowly). Same when moving left and right. How do I fix this so moving backwards, left and right is the same speed as moving forward? I think this is the code: [CODE]function GM:Move(pl, movedata) if pl:IsOnGround() or !pl:Alive() or pl:WaterLevel() > 0 then return end local aim = movedata:GetMoveAngles() local forward, right = aim:Forward(), aim:Right() local fmove = movedata:GetForwardSpeed() local smove = movedata:GetSideSpeed() forward.z, right.z = 0,0 forward:Normalize() right:Normalize() local wishvel = forward * fmove + right * smove wishvel.z = 0 local wishspeed = wishvel:Length() if(wishspeed > movedata:GetMaxSpeed()) then wishvel = wishvel * (movedata:GetMaxSpeed()/wishspeed) wishspeed = movedata:GetMaxSpeed() end local wishspd = wishspeed wishspd = math.Clamp(wishspd, 0, 30) local wishdir = wishvel:GetNormal() local current = movedata:GetVelocity():Dot(wishdir) local addspeed = wishspd - current if(addspeed <= 0) then return end local accelspeed = (120) * wishspeed * FrameTime() if(accelspeed > addspeed) then accelspeed = addspeed end local vel = movedata:GetVelocity() vel = vel + (wishdir * accelspeed) movedata:SetVelocity(vel) return false end[/CODE]
That code is fine
[B][U]Don't override default hook functions[/U][/B]
He is using the deathrun gamemode on github, not his own one.
[QUOTE=AIX-Who;48228203]He is using the deathrun gamemode on github, not his own one.[/QUOTE] Yeah exactly, I haven't changed anything. And maybe thats not the code then since speed is still fucked.
Sorry, you need to Log In to post a reply to this thread.