Why is the mouse clicking 2 guis?
Hey, I've posted this on DevForums, I'm just reposting it here bc devforums is inactive.
So, I made a guis mode for my aim training game (for mobile users) and when I click a target, it clicks the target and clicks the background (which you are not supposed to click). Can somebody possibly tell me why this is happening? I tried to increase the ZIndex for the target gui, still doesn't work. Heres the code:
01 | game.ReplicatedStorage.OnClick.Event:Connect( function (gui) |
05 | script.Parent.MainGui.Hit:Play() |
06 | local x, y = math.random( 1 , 9 ), math.random( 1 , 9 ) |
12 | createNewPart(UDim 2. new(x / 10 , 0 , y / 10 , 0 )) |
16 | script.Parent.MainGui.Holder.InputEnded:Connect( function (input) |
18 | if input.UserInputType = = Enum.UserInputType.MouseButton 1 or input.UserInputType = = Enum.UserInputType.Touch then |
23 | script.Parent.MainGui.DidNotHit:Play() |
Hope you can help ._.