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!
I am trying to make a ATM gui where if you touch a part, it moves the frame to your screen using Tweens, but the problem here is that the GUI seems to be glitchy,
and it keeps entering/exiting the screen even though I’m just touching it. -
What is the issue? Include screenshots / videos if possible!
This is a visual representation of what keeps happening. ^
Here is the touched script.
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent.Humanoid
local plr = game.Players:GetPlayerFromCharacter(humanoid.Parent)
plr.PlayerGui.Bank.Frame.Visible = true
plr.PlayerGui.Bank.Frame:TweenPosition(UDim2.new(0.217, 0, 0.031, 0), "Out", "Linear", 0.5)
wait(0.3)
end)
script.Parent.TouchEnded:Connect(function(hit)
local humanoid = hit.Parent.Humanoid
local plr = game.Players:GetPlayerFromCharacter(humanoid.Parent)
plr.PlayerGui.Bank.Frame:TweenPosition(UDim2.new(0.217, 0, -2, 0), "Out", "Linear", 0.5)
wait(0.3)
plr.PlayerGui.Bank.Frame.Visible = false
end)
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried removing the tweens and making the gui visible/not visible when you touch or stop touching it, but the same things happen. I don’t have too much experience with Touched events but if anybody could help it would be really appreciated!!