function CharacterRealism.StepValue(h,R,j)local q=R.Current or 0 local y=R.Goal local b=5/(j*60)local P=math.min(1,(j*20)/3)local v=math.min(P,math.abs(y-q)/b)R.Current=Util:StepTowards(q,y,v)return R.Current end
-- Interpolates the current value of a rotator
-- state (pitch/yaw) towards its goal value.

function CharacterRealism:StepValue(state, delta)
	local current = state.Current or 0
	local goal = state.Goal

	local pan = 5 / (delta * 60)
	local rate = math.min(1, (delta * 20) / 3)

	local step = math.min(rate, math.abs(goal - current) / pan)
	state.Current = Util:StepTowards(current, goal, step)

	return state.Current
end
