button.Activated not working in mobile

I have a button in my game that has a script that runs when button.Activated is called, it works fine on PC but on mobile the animation that plays on button.Activated stays running even after I remove my finger.

(Or maybe it’s button.InputEnded that doesn’t work right :thinking:)

I’d assume it’s the inputEnded. Could you add a print statement after the inputEnded and .Activated events? If both print on mobile, the issue would be with something else.

Both the .Activated and the .InputEnded seem to print and activate fine, I’m wondering now if its this code:

			button.MouseEnter:Connect(function()
				print("mouse enter")
				button.gradient.Enabled = true

				tween_service:Create(button, info, {BackgroundTransparency = .8}):Play()
				tween_service:Create(button.icon.scale, info, {Scale = 1.4}):Play()
			end)

Here is the .Activated and .InputEnded for reference:

			button.Activated:Connect(function()
				print("started input")
				
				tween_service:Create(button, info, {BackgroundTransparency = .95}):Play()
				tween_service:Create(button.icon.scale, info, {Scale = .8}):Play()

				tween_service:Create(frame.menu.scale, slow, {Scale = .95}):Play()
			end)

			button.InputEnded:Connect(function()
				print("ended input")
				button.gradient.Enabled = false

				tween_service:Create(button, info, {BackgroundTransparency = 1}):Play()
				tween_service:Create(button.icon.scale, info, {Scale = 1}):Play()

				tween_service:Create(frame.menu.scale, slow, {Scale = 1}):Play()
			end)

try button.MouseButton1Up or button.MouseButton1Down instead of button.Activated. i remember reading somewhere that these two events worked on mobile, as opposed to .Activated.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.