i made a bubble gun that emits particles and sound when clicked , everything works perfectly on pc but for mobile users only the particles dont emit when tapped on the tool except the sound and animation works perfectly. Heres the script what should i change for it to work the same on mobile?
Sure! Before you will have to find out if your player is on mobile or PC. For this you should use the userinputservice to clarefie, if the player is on PC or mobile with this script:
local UserInputService = game:GetService(“UserInputService”)
if UserInputService.KeyboardEnabled and UserInputService.MouseEnabled then
print(“Player is on a PC”)
elseif UserInputService.TouchEnabled then
print(“Player is on a mobile device”)
else
print(“Player is on an unknown device”)
end
If player was on PC you can keep using activated.
If he was on mobile you should use the TouchTap event.
It is the same as Activated but for touchscreens.
thank you, i see that userinputservice could be used , i dont know how to modify it for my code , do u mind if u can spare a moment to modify my code please?