I’m currently working on a round based game where player’s golf. Development is coming along very swell, but I noticed an issue while testing on my IPad. I noticed that because I am using UserInputService and Enum.UserInputType.MouseButton1, Player’s are unable to control the GolfBall on mobile devices.
I was wondering if there is some sort of alternative that I can use that will allow for me to detect when a player taps on the screen. I am also using Mouse.Hit and I was wondering if that works on mobile devices.
Does Enum.UserInputType.TouchTap not suffice for your use case?
It does but it’s unrecommended to use it because Mouse.Hit doesn’t update live on mobile devices and mobile devices don’t have a mouse. Consider ViewportPointToRay, which constructs a unit ray based off of a 2D position. Here, you can feed the position of the touch via InputObject.Position.
Mouse.Hit is a simplification of the above anyway, except it also extends the unit ray.