Need help delaying mouse in first person

I made a script to delay an image label for your cursor, but it doesn’t delay it in first person.

game.Players.LocalPlayer:GetMouse().Icon = "rbxassetid://12886288372" -- set the normal cursor icon to nothing
local mouse = game.Players.LocalPlayer:GetMouse()

game:GetService("RunService").RenderStepped:Connect(function()
	game:GetService("TweenService"):Create(script.Parent.Cursor, TweenInfo.new(.1), {Position = UDim2.new(0,mouse.X, 0,mouse.Y)}):Play() -- Only delays the mouse if the last position was different than the current position
end)

I would assume I would have to use your camera position or something like that. Does anyone know how I could fix this?

2 Likes

Could you describe more in depth what you mean by delay?

2 Likes

Do you mean delay like you move it and it lags behind for a short time but it is still moving until it reaches the actual position of the mouse cursor?

1 Like

Yes. You can see the image label moves a little slower than the actual mouse and I want the to happen in first person
Edit: Sorry I thought I posted a video too :skull::skull::skull:

Okay, I will take your script and see what I can do with it to try and get it to work.

Okay here I tried it out and it looks nice this is the script.

local twnservice = game:GetService("TweenService")
local imageLabel = script.Parent
local tweenInfo = TweenInfo.new(0.1)
game.Players.LocalPlayer:GetMouse().Icon = "rbxassetid://12886288372"
local function updatePosition()
	local mouse = game.Players.LocalPlayer:GetMouse()
	local mousePosition = UDim2.new(0, mouse.X, 0, mouse.Y)
	local tween = twnservice:Create(imageLabel, tweenInfo, {Position = UDim2.new(0,mouse.X, 0,mouse.Y)})
	tween:Play()
end

game:GetService("RunService").RenderStepped:Connect(updatePosition)

So it isn’t exactly the most fast but it looks nice and I don’t think there wouldn’t be issues. Lmk if it works.

1 Like

Its not different than my script :upside_down_face:

Well I guess I will try again because I felt like it worked but I guess it didn’t. Sorry.

I think I may have misunderstood something. Instead of an unlocked mouse in third person you mean in first person where the mouse is locked and then there is slightly delayed camera movement? Cause I might be able to do something like that.

Kind of. I already delayed the camera in first person, but I want to delay the mouse in first person as well.

I’m kind of stumped right now. The only thing I can think of currently is to get the differences in X and Y Orientation values with too different Camera Orientation values which would be a current value and past value and then turn that into a pixel x and pixel y value to tween the position of the imagelabel to it. But I don’t know how to do this yet so I will keep experimenting.