Players bouncing up and down as they walk

My players keep bouncing up and down while they walk. No console errors at all.


function round.Begin(ply)
	canSpawnPLY = true
	canSpawnWEP = true

	for _, v in pairs(player.GetAll()) do
		if canSpawnPLY then
			if !v:Team(TEAM_NEUTRAL) then
				v:SetTeam( TEAM_NEUTRAL )
			end
			
			if not v:Alive() then
				v:StripWeapons()
				v:StripAmmo()
				v:Spawn()
				canSpawn = false
				canSpawnWEP = false
			end
		end
		
	end	
	round.Broadcast("Round starting! Round ends in " .. round.Time .. " seconds!")
	round.TimeLeft = round.Time
end

function GM:PlayerSpawn( ply )

	if canSpawnPLY then
		ply:SetTeam( TEAM_NEUTRAL )
	else
		ply:SetTeam( TEAM_SPEC)
	end
	
	if ply:Team() == TEAM_NEUTRAL then
		ply:SetModel("models/player/odessa.mdl")
		ply:SetGravity(0)
		ply:SetWalkSpeed(250)
		ply:SetRunSpeed(500)
		ply:SetCrouchedWalkSpeed(0.5)
		ply:SetDuckSpeed(0.5)
	end
	
end

Why does the first function have a ply argument when you aren’t using it?

I’ve been doing a lot of experimenting lately to learn GLua, its the remnants of a previous set up that I overlooked.

ply:SetGravity(0)
whats happening is the players spawn as spectator, get set to low gravity then join a team but they still remain low gravity

you can either a. set their gravity to the default when they spawn and are in a team
or b. force spectators/neutrals into noclip/spectate mode and avoid using setgravity entirely

I set gravity to 1 if the team is TEAM_NEUTRAL.


function GM:PlayerSpawn( ply )

	if canSpawnPLY then
		ply:SetTeam( TEAM_NEUTRAL )
	else
		ply:SetTeam( TEAM_SPEC)
	end
	
	if ply:Team() == TEAM_NEUTRAL then
		ply:SetModel("models/player/odessa.mdl")
		ply:SetGravity(1)
		ply:SetWalkSpeed(250)
		ply:SetRunSpeed(500)
		ply:SetCrouchedWalkSpeed(0.5)
		ply:SetDuckSpeed(0.5)
	end
	
end

function GM:PlayerDeath( victim, weapon, killer )
	victim:SetTeam(TEAM_SPEC)
	victim:KillSilent()
	if victim:Team() == TEAM_SPEC then
		victim:Spectate( OBS_MODE_ROAMING )
		victim:SpectateEntity( killer )
		victim:StripWeapons()
		victim:StripAmmo()
	else
		victim:UnSpectate()
		victim:SetTeam(TEAM_NEUTRAL)
	end
end


I only set gravity for the neutral team so shouldn’t this work? Unless i’m overlooking something.

sffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfd dffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddf fddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffd fdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsf fsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddf fddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffd dffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfd fdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffs fddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffd dffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddf fdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfd sffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfd dffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddf fddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffd fdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsf fsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddf fddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffd dffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfd fdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffs fddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffd dffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddf fdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfd sffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfd dffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddf fddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffd fdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsf fsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddf fddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffd dffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfd fdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffs fddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffd dffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddf fdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfd sffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfd dffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddf fddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffd fdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsf fsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddf fddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffd dffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfd fdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffs fddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffd dffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddf fdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfd sffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfd dffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddf fddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffddffd fdfdsffsfddffddffddffdfdfdsffsfddffddffddffdfdfdsf fsfddffddffddffdfdfdsffsfddffddffddffdfdfdsffsfddf fddffddffdfdfdsffsfddffddffddffdfdfdsffsfddffddffd dffdfdfd