I dont have a camera offset but rather I cloned the player’s character and set it to the actual one’s CFrame with a bit of an offset. I can’t seem to fix this jittering when the player’s turn though. I’ve tried lerping it but you can still see some jittering.
No I don’t want to use the humanoid camera offset because it makes the camera no clip through walls. Even if I did use the camera offset, it wouldn’t fix the character jittering. The character you see also isn’t the player’s real character but rather a clone of it.
Hi, try *RenderStepped* instead of Heartbeat.
You can also try Character:PivotTo() since it esentially lerps the whole character model instead of just the Root Part.
It might also be smart to assign your variables outside of the loop and just do simple type checking in case they’re .Destroyed, since if they nil your code will vomit errors on the output.
If you just want a camera offset without noclipping, just use a raycast from the head or make a simple collision check part that positions itself to the camera, and check if it gets .Touched by something different than the character.
Sorry for the large amount of edits, I haven’t used the dev forum in pretty long .
I can’t pivot the character as I’m also playing animations too. If I pivot and play my crouch animation, the player doesn’t touch the ground and floats. Also, if I change the camera offset instead of cloning the character, it’s still pretty jittery with the player’s real camera.
You can account for the Humanoid.HipHeight on the Y-Axis.
Aw shucks. Are you doing this on a LocalScript? If not then that’s the problem. The server and client will never be synced perfectly, if they were that’d be wild but they aren’t.
You can perform simple sanitation checks and use a UnreliableRemoteEvent since it skips failed triggers, to tell the server the clients current position. It might also be smart to do this everytime the player moves, not on a loop.
Okay, I thought for longer (I sound like AI ) and if these solutions don’t work then I don’t know what else will.
Try to lerp directly from the target
Use heartbeat and do some math (or ask AI to do it for you) and make a Lerp Alpha that accommodates with the DeltaTime
Just unanchor the clone, no collisions, or Humanoid.PlatformStand = true and use a WeldConstraint to the real one. I see this as the most viable solution.
The closest that i can find fixing this so far is using BindToRenderStep from RunService which may sound like it works identically to RenderStepped or Heartbeat but that’s kinda how i fix most of jittering issues with it
sorry for getting to this so late… if you still havent solved this:
--// Services
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
--// Storage
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local RootPart = Character:WaitForChild("HumanoidRootPart") :: BasePart
local CurrentCamera = workspace.CurrentCamera
local OFFSET = CFrame.new(0, 0, -2)
local Part = Instance.new("Part")
Part.Anchored = true
Part.CanCollide = false
Part.CanQuery = false
Part.CanTouch = false
Part.Size = RootPart.Size
Part.Parent = CurrentCamera
local SelectionBox = Instance.new("SelectionBox")
SelectionBox.Transparency = 0.25
SelectionBox.Parent, SelectionBox.Adornee = Part, Part
local conn = nil :: RBXScriptConnection
conn = RunService.PreAnimation:Connect(function(dt)
local goal = Part:GetPivot():Lerp(RootPart:GetPivot() * OFFSET, 60 * dt)
Part:PivotTo(goal)
end)
itd seem using deltaTime is essential to prevent jittering
i didnt bother to setup a cloned character because i didnt feel like going through all that hassle for a quick example, but i hope this helps
this might be from server-client delay, it’s a possible chance it might be that the HRP is rotating on the server-side
or if that’s not the case, it’s probably the way the :Lerp function handles constantly moving objects. (idk what it could be lol, but it’s just a theory)
No I’ve said earlier that its all client sided. Even if you don’t character clone and just have the player’s camera in first person and turn their body transparency to 0, you can still see the jittering.