I have a reticle that moves with the camera to make it more immersive but when the player moves its weird, is there a way to disable it following the players movement or whatever it is called?
local Camera = workspace.CurrentCamera
local UDimLerp = UDim2.new()
local Client = game:GetService("Players").LocalPlayer
task.wait(1)
for i,v in next, Camera:GetChildren() do
if v:IsA("Model") and v.Name == "Viewmodel" then
Viewmodel = v
end
end
game:GetService("RunService").RenderStepped:Connect(function(dt)
if Camera.CFrame.Position and Viewmodel:FindFirstChild("Handle") then
local Handle = Viewmodel:FindFirstChild("Handle")
local Glass = Handle:FindFirstChild("ProjectorSight")
local Gui = Glass:FindFirstChild("SurfaceGui")
local Reticle = Gui:FindFirstChild("Reticle")
local Direction = Vector3.new(0, 0, 300.0) - Glass.CFrame:PointToObjectSpace(Camera.CFrame.Position)
local Normalized = ((Direction / Direction.Z) * 50.0) / Glass.Size
UDimLerp = UDimLerp:Lerp(UDim2.new(0.5 - Normalized.X, 0, 0.63 + Normalized.Y, 0), game:GetService("TweenService"):GetValue(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out))
Reticle.Position = UDimLerp
end
end)
Thanks for the help