So I want a crystal to follow above your head, it works, but it is jumpy and stuff. I want it to be really smooth. If you can help me fix this thank you. Btw, this is a local script before you say anything.
function MoveCrystal() local character = game.Players.LocalPlayer.Character local crystal = workspace.Crystal local head = character["Head"] local objectSpace = CFrame.new(0, 2, 0) local worldSpace = head.CFrame:toWorldSpace(objectSpace) crystal.CFrame = worldSpace end while wait() do MoveCrystal() end
Right now, you're using a wait(). That wait time can be smooth sometimes, but since you're saying it isn't, you could either use while wait(-1) do
, or you could use this script instead of the while:
game:GetService('RunService').RenderStepped:connect(function() MoveCrystal() end)
Stepped is like a while wait() do
, but it repeats every 60th of a second!
EDIT: Didn't notice you said it was a localscript. Stepped is for serverscripts, and RenderStepped is for localscripts ;D