I have tried looking for a property, within the UI, that might have something to do with unlocking the mouse when holding the right click. Didnt find anything so hoping someone out there could help!
Here is the code I’m using:
local animTime = .15
local delay = 2
function CC.Spawn()
local ClickCircle = ccUI:Clone()
local endSize = ClickCircle.Size
local pos = UIS:GetMouseLocation()
ClickCircle.Position = UDim2.new(0,pos.X,0,pos.Y-36)
ClickCircle.Size = UDim2.new(0,0,0,0)
ClickCircle.Parent = plr.PlayerGui.ScreenGui
ClickCircle:TweenSize(endSize, Enum.EasingDirection.In, Enum.EasingStyle.Linear, animTime)
task.wait(animTime/delay)
local Info = TweenInfo.new(animTime-animTime/delay)
local Tween = game:GetService("TweenService"):Create(ClickCircle, Info,{BackgroundTransparency=1})
Tween:Play()
Tween.Completed:Wait()
ClickCircle:Destroy()
end
if holdingRightClick then
UIS.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
end
But yea doesn’t seem to do anything I suspect that it’s because the current position of the mouse is already locked but the mouse move function within Roblox is still trying to move the mouse while it’s locked. Also explains why it’s jittering back and forth sometimes in the video.
You can make the click circle appear at the locked mouse position by creating a variable which stores the mouse position when UserInputService.MouseBehavior is set to LockCurrentPosition and setting the mouse position variable to nil when UserInputService.MouseBehavior is not set to LockCurrentPosition
local LockedMouseLocation = nil
RunService.RenderStepped:Connect(function()
if UIS.MouseBehavior == Enum.MouseBehavior.LockCurrentPosition then
if LockedMouseLocation == nil then
LockedMouseLocation = UIS:GetMouseLocation()
end
else
LockedMouseLocation = nil
end
end)
And if the mouse position variable is not equal to nil then use it as the position for the click circle