Desmos not translating to Studio (Am I translating wrong?)

In Desmos, I made a simple skewed sin wave for the view model to follow for a more realistic bobble. For some reason though, the frequency(f) isn’t translating to the game properly. I temporarily disabled the Y-axis for a better idea.

Code (sway is earlier in the function and I don’t want to make you have to find the lines yourself):

	local a = -.5
	local f = 5
	local x = 1
	
	local now = os.clock()
	local vel = root.AssemblyLinearVelocity
	local bobX = math.sin(f*x+a*math.sin(f*x)*now) / 25
	local bobY = math.cos(4*now) / 30
	
	if vel.Magnitude > 0 then
		local s = math.min(1, vel.Magnitude / hum.WalkSpeed)
		
		local calc = CFrame.Angles(bobX*bobMult*s, 0, 0) --bobY*bobMult*s
		
		bobble = bobble:Lerp(calc, .1)
		
		vm.CameraBone.CFrame = vm.CameraBone.CFrame * bobble * sway
	else
		vm.CameraBone.CFrame = vm.CameraBone.CFrame * .75 * sway
	end

Video:

Any help is appreciated!

Try replacing x = 1 with x = now and just copying your formula character for character from desmos

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.