Camera spring jitters with velocity

Hello!! I’ve been using Quenty // Nevermore spring module with my camera and it works fine when the character is walking, whoever, when I implement it to my flying script, the character (or the camera) jitters a lot. Here’s the module I’ve used: Free smooth camera example - Roblox

Local Script code:

local fakePlayerHead = Instance.new("Part")
fakePlayerHead.Parent = camera
fakePlayerHead.Anchored = true
fakePlayerHead.CanCollide = false
fakePlayerHead.CanQuery = false
fakePlayerHead.CanTouch = false
fakePlayerHead.Transparency = 1
fakePlayerHead.Size = Vector3.new(1,1,1)

local fakePlayerHeadSpring = SpringModule.new(camera.CFrame.Position) 
fakePlayerHeadSpring.Target = camera.CFrame.Position
fakePlayerHeadSpring.Speed = 15
fakePlayerHeadSpring.Damper = 0.8

RunService.Stepped:Connect(function()
	camera.CameraSubject = fakePlayerHead

	fakePlayerHeadSpring.Target = Head.Position + camera.CFrame.RightVector * 2 + camera.CFrame.UpVector * 1.5
	fakePlayerHead.Position = fakePlayerHeadSpring.Position
end)

hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	FlightEvent:FireServer(flying, CurrentSpeed)
end)

Server Script code:

FlightEvent.OnServerEvent:Connect(function(player, status, multiplier)
	local BV = player.Character.PrimaryPart:FindFirstChild("BodyVelocity")
	TS:Create(BV,TweenInfo.new(0.25),{Velocity = player.Character.Humanoid.MoveDirection * 80}):Play()
end)

To fix this I tried:

  • Creating the spring with the time function (local fakePlayerHeadSpring = SpringModule.new(camera.CFrame.Position, time))
  • Changing the Run Service to HeartBeat, BindToRenderStep (with camera value), Stepped…
  • Creating and managing the BodyVelocity in the client side.
  • Using a simpler position formula with the head position only.
  • Lerping and tweening the position.
  • Removing the tween of the Body Velocity.
  • Using Linear Velocity instead.

Anyone know how to fix this? Changing the code or do you guys know a more optimized spring module to get the same effect?? Thank you.

Have you tried RenderStepped too ?

Nevermind, after looking at it, it looks like your player jitters, not the camera. Its hard to see without objects but look at baseplate for example, looks smooth.

After days of searching, I’m just going to use this code to achieve the same effect without using the spring module. It’s basically the same thing, creating a fake invisible part for the camera subject and modifying the position. This works smooth:

This should work, since your character is physics controlled!

local fakePlayerHeadSpring = SpringModule.new(camera.CFrame.Position, time)

You’ll want to also make sure Damper >= 1, since 0.8 will create a bounce explicitly.

fakePlayerHeadSpring.Damper = 1.5
1 Like

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