Arms movement looking quite weird

So basically, you’re going to save the LeftShoulder and RightShoulder C0 values at the top of your code as a global variable, these values are updated under RenderStepped. Then, under Stepped, the code will update LeftShoulder and RightShoulder according to the saved values.

local futureRightShoulder = CFrame.identity
local futureLeftShoulder = CFrame.identity
RunService.RenderStepped(function(dt)
  ...
  futureRightShoulder = HRP.CFrame:ToObjectSpace(...)
  futureLeftShoulder = HRP.CFrame:ToObjectSpace(...)
end)
RunService.Stepped(function(t, dt)
  RightShoulder.C0 = futureRightShoulder
  LeftShoulder.C0 = futureLeftShoulder
end)

As for the camera jittering, it appears it might’ve stem from these lines of code:

local z = math.rad(HumDirection.X*2.5 + (lasty-y)*20)
local ZRot = CFrame.Angles(0,0,-math.clamp(z,-10,10)):Inverse()

Could you test it out by commenting out these lines to see if it still jitters?

I will in a bit as currently I am a bit busy.

Ah, alright no problem, thanks for the help. I just want the cam jitter to be mainly fixed as thats my priority bug and it effects gameplay more than the arms.

Take your time doing so, any help matters!

1 Like

No jitter. And just as I enabled it jitter happened. + (lasty-y)*20 this part causes the problem.
Yep! Thats the issue right there. Because sudden increase:
image
with


	local z = math.rad(HumDirection.X*2.5 + (lasty-y)*20)
	print(math.round((lasty-y)*20),math.round((lasty-y)*20) > 2)

Any idea?

You could try smoothing it out maybe?

local alpha = 0.1  -- control the smoothing (lower values make it smoother)
local smoothedDeltaY = 0

local deltaY = lasty - y
smoothedDeltaY = smoothedDeltaY * (1 - alpha) + deltaY * alpha

local z = math.rad(HumDirection.X * 2.5 + smoothedDeltaY * 20)
print(math.round(smoothedDeltaY * 20), math.round(smoothedDeltaY * 20) > 2) -- debug

You could try to use math.clamp for this, or maybe use * math.min(dt*60, 1)?

Alright! It has been fixed! Thank you for the help! Now the only problem remaining is the… well… arms.

Have you tried the solution I posted above prior to this?

Just tested and the results were negative. Sorry for such late response. I was studying my exam.

What about the RunService:BindToRenderStep() method?

I have been using that for quite some time and well no use.

My only guess might be because it’s not anchored.
I quite of have to assume you are forced to make a viewmodel for that as this is the extent I can only do. But feel free to try and find workarounds for that!

I once saw a topic about it but I can’t really find it. Thanks for the help though!

1 Like

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