Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Very jittery movement when trying to change CFrame?

Asked by 1 year ago

I have the following code:

local LocalPlayer = game.Players.LocalPlayer

workspace:WaitForChild(LocalPlayer.Name)

local Mouse = LocalPlayer:GetMouse()
local RunService = game:GetService("RunService")
local UpperTorso = LocalPlayer.Character:WaitForChild("UpperTorso", 5)

RunService.RenderStepped:Connect(function ()    
    UpperTorso.CFrame = CFrame.new(UpperTorso.Position, Vector3.new(Mouse.Hit.Position.X, Mouse.Hit.Position.Y, Mouse.Hit.Position.Z))
end)

But when I run it, this is what is looks like.

Any Ideas?

0
So that you're aware I will be offline for the next 8-9 hours, but any answers would be appreciated. iggyjelly1 26 — 1y
0
Idk maybe try switching from Mouse.Hit.Position.Y to UpperTorso.Position.Y on line 10 virushunter9 943 — 1y
0
are you trying to smoothly move the part?, if so use tween service, here is a video about it: https://www.youtube.com/watch?v=DLI5yw0Rtc0&t=81s johojohojockdw 0 — 1y

Answer this question