You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
When the mouse enters a frame the UIStroke thickness goes to 1.5 and back to 0 when the mouse leaves.
What is the issue? Include screenshots / videos if possible!
Whenever the UIStroke thickness changes it’ll instantly change back, even if I try to manually do it in Explorer When the mouse hovers When I try to manually change it
there’s no loops or anything making it revert to it’s original thickness.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local SoundService = game:GetService("SoundService")
local actionHolder = script.Parent:WaitForChild("actionHolder")
local top = script.Parent:WaitForChild("top")
local pages = actionHolder:WaitForChild("Pages")
local UiSounds = SoundService:WaitForChild("Ui")
local numPages = #pages:GetChildren() - 1
local pageNumber = 1
-->> Animations
local function enterFrame(frame)
if frame == nil then return end
if frame:FindFirstChild("UIStroke") and frame:FindFirstChild("UICorner") then
local UIStroke = frame.UIStroke
local UICorner = frame.UICorner
local TweenTime = .1
UiSounds:WaitForChild("TabChange"):Play()
local tween = TweenService:Create(UICorner, TweenInfo.new(TweenTime), {CornerRadius = UDim.new(0.2,0)}):Play()
local tween = TweenService:Create(UIStroke, TweenInfo.new(TweenTime), {Thickness = 1.5}):Play()
else
return end
end
local function exitFrame(frame)
if frame == nil then return end
if frame:FindFirstChild("UIStroke") and frame:FindFirstChild("UICorner") then
local UIStroke = frame.UIStroke
local UICorner = frame.UICorner
local TweenTime = .1
local tween = TweenService:Create(UICorner, TweenInfo.new(TweenTime), {CornerRadius = UDim.new(0.6,0)}):Play()
local tween = TweenService:Create(UIStroke, TweenInfo.new(TweenTime), {Thickness = 0}):Play()
else
return end
end
-->> Animation Connection
for i,v in pairs(pages:GetDescendants()) do
if v:IsA("Frame") then
if v:FindFirstChild("UIStroke") and v:FindFirstChild("UICorner") then
v.MouseEnter:Connect(function()
enterFrame(v)
end)
v.MouseLeave:Connect(function()
exitFrame(v)
end)
end
end
end
I don’t think it’d be a problem with the script because even if I manually change it in explorer, it just goes back to the old thickness. There’s no loops anywhere causing this
I appreciate the module link, I always love to use modules to improve efficiency. However I doubt that it’s anything to do with the mouse connections as the other tween plays perfectly as shown in the first gif. And in the second gif when I manually change it in explorer playergui it reverts instantly to 0 thickness as well leading me to think this is ROBLOX related
I appreciate you helping me look into it. I figured out the problem. I have a module called UIStrokeAdjuster Module and disabling this module fixed it.