You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
So lets say you had a Menu like I do, And there are few buttons that you want to Animate [kinda], so if you haver your mouse or hold your finger on the button! It will hmm, make it less Transparent! And if you let your finger go or Move your mouse away from the button, the Transparency rises! Watch this video:
What is the issue? Include screenshots / videos if possible!
Its probably very laggy or doesn’t even work! Sorry if it does/doesn’t! Tell me and I’ll try and fix it or post the video on other platforms!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I honestly have no clue what to search, if someone else had the same issue as me they might take a while to find this topic as well…
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
So what I used is TweenService but it doesnt fix the problem unfortunately, Nor does a for loop! I wanted to check If statements every
few seconds to see if the mouse is still there but that would take s o o long! Is this even possible? Please help I always wanted to know!
-- Thanks for stopping by!
Edit: A the slightly laggy video doesn’t really show what its like! Sorry! But I hope you get the idea!
Edit2: WOW I was right… It does take forever for people to find this topic!-
local ChapterNumber = 1
local Object = script.Parent.Parent:WaitForChild("GradientChapter"..ChapterNumber)
StartingTransparency = 0.6
local TweenService = game:GetService("TweenService")
local InformatioNTween = TweenInfo.new(
.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
local InformationTableValues = {
BackgroundTransparency = StartingTransparency
}
TweenServiceCreateUnTransparent = TweenService:Create(Object,InformatioNTween,InformationTableValues)
script.Parent.MouseEnter:Connect(function()
if script.Parent.Parent.Parent:WaitForChild("TweenServiceCanContinue").Value then
TweenServiceCreateUnTransparent:Play()
end
end)
local InfoTweenService = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local TableProperty = {
Transparency = 0.8
}
local CreateTweenTransparent = TweenService:Create(Object,InfoTweenService,TableProperty)
script.Parent.MouseLeave:Connect(function()
if script.Parent.Parent.Parent:WaitForChild("TweenServiceCanContinue").Value then
CreateTweenTransparent:Play()
end
end)
See the first variable? All the scripts in the EXPLORER that go by the name Chapter[1,2,3,4,5,6]Script Are the same but with a different variable [First line]
also
if script.Parent.Parent.Parent:WaitForChild("TweenServiceCanContinue").Value then
end
is just a Value i set every time so the tween can continue like you said but different 0:!
[im having deja vu aaa]
Don’t worry its fine, good luck at work by the way, also
this was a huge mess and unfortunately it still doesn’t work! Still looks fine!
Thanks for the help! Here is a video showing it: a prepare to be traumatized by script!
Im not even sure that is the righ video but There you go!
Read after watching!
Did you just watch a whole video of me just moving my mouse…? wow!
OHHHHHHHH i forgot something in the script aaaa brb i fix it!
AAAAAAAAAA it doesn’t work
I think it would more be cleaner and less redundant to just loop over your text buttons and tween them upon MouseEnter and MouseLeave. Something like this:
local tween
for _, textButtons in pairs(frame:GetChildren()) do -- frame being the parent container
if textButtons:IsA('TextButton') then
textButtons.MouseEnter:Connect(function()
tween = tweenService:Create(textButtons, InformatioNTween , {BackgroundTransparency = .8})
tween:Play()
end)
textButtons.MouseLeave:Connect(function()
tween = tweenService:Create(textButtons, InformatioNTween , {BackgroundTransparency = .6})
tween:Play()
end)
end
end
Good Point! Thanks for the tip now I will try that ;-; Lemme just implement it first…
Also I have an idea but first… Does Tween come with :Stop() or :Pause() like sounds do? ?
Yeah. It has Cancel, Pause and Play, where Stop() is basically cancel here. For more information, look into its API. Also sidenote, looking into your explorer I notice that you have a local script in each button which I definitely don’t recommend. That can really be packed into one script which just makes it a lot more organised, easier for yourself to work with and easier for other to read/ work with your scripts.