this has been hurting my brain for over a week
single player:
multi player:
roblox player:
starter player scripts:

code (local script):
local player = game.Players.LocalPlayer
local characterLoadEvent = game.ReplicatedStorage.CharacterLoadEvent
characterLoadEvent:FireServer()
local character
local collider
player.CharacterAdded:Connect(function(newCharacter: Model)
character = newCharacter
collider = newCharacter:WaitForChild("Collider")
end)
local camera = workspace.CurrentCamera
local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local compile = require(script.Compile)
userInputService.MouseDeltaSensitivity = 0.01
local inputDirection, grounded
local jumping = false
--EveryFrame
runService.RenderStepped:Connect(function(deltaTime)
compile.camera(collider, camera, Vector3.new(0, 2.3, 0))
end)
--PrePhysicsSimulation
runService.PreSimulation:Connect(function(deltaTimeSimulation)
local simulationCorrection = deltaTimeSimulation * 240
inputDirection, grounded = compile.getMovementDetections(character, collider, camera)
if grounded and not jumping then
compile.groundMovement(collider, inputDirection, 20, 20, 32, simulationCorrection)
else
compile.airMovement(collider, inputDirection, 100, 32, simulationCorrection)
end
end)
--OnInput
userInputService.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.KeyCode.Space and grounded and not jumping then
compile.jump(collider, 30)
jumping = true
task.wait(0.2)
jumping = false
end
end)


