I am trying to get a part’s CFrame to match the CFrame of a HumanoidRootPart.
However, when I do this, the orientation of the part seems to be delayed by at least one frame. I am currently updating the code in a PreRender loop. The bizarre thing is the position perfectly matches the HumanoidRootPart despite the orientation always being off.
I’ve tried switching RenderStepped with PreRender and :BindToRenderStep (using Enum.RenderPriority.Last) yet this still doesn’t get the orientation to update properly.
Code:
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local character = localPlayer.Character
local humanoidRootPart = character.HumanoidRootPart
local testPart = Instance.new("Part")
testPart.CanCollide = false
testPart.Anchored = true
testPart.Parent = workspace
local function updatePart()
testPart.CFrame = humanoidRootPart.CFrame
end
RunService.RenderStepped:Connect(updatePart)
Video of issue (notice how the part follows my position without delay but not my orientation)