local e=Vector3_new(1,1,1)local function J()return e end local function B(e)if getAutoJump()and enableAutoJump()then local e=J()if not vec3IsZero(e)then doAutoJump()end end end local function g()local e={}local J=false local g=nil function e.Run(B)J=true local M=nil M=coroutine.create(function()while J and M==g do e:Step()wait()end end)g=M coroutine.resume(M)end function e.Stop(e)J=false end function e.Step(e)B()end return e end

local walkVelocityVector = Vector3_new(1,1,1)
local function calcDesiredWalkVelocity()
	-- TEMP
	return walkVelocityVector
end

local function preStepSimulatorSide(dt)
	if getAutoJump() and enableAutoJump() then
		local desiredWalkVelocity = calcDesiredWalkVelocity();
		if (not vec3IsZero(desiredWalkVelocity)) then
			doAutoJump();
		end
	end
end

local function AutoJumper()
	local this = {}
	local running = false
	local runRoutine = nil

	function this:Run()
		running = true
		local thisRoutine = nil
		thisRoutine = coroutine.create(function()
			while running and thisRoutine == runRoutine do
				this:Step()
				wait()
			end
		end)
		runRoutine = thisRoutine
		coroutine.resume(thisRoutine)
	end

	function this:Stop()
		running = false
	end

	function this:Step()
		preStepSimulatorSide()
	end

	return this
end
