Make a Mouse for mobile

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want a mouse( just like in a computer), but for mobile and show where the mouse is currenlty

  1. What is the issue? Include screenshots / videos if possible!

I don’t know how to approach this kinda stuff, iam not asking you for to write a script but to point me to the right direction

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I looked every where but could it find anything

7 Likes

Do phones not get a cursor when there’s a mouse plugged into them?
My phone has that kinda feature

2 Likes

No, i mean like that, i mean like when you join a game you have a curso

2 Likes

I’m not really good at scripting but here’s what I think: use a ImageLabel and update it’s position based when the player Touches the screen and move it to that position.

Here’s a possible way to do it (I haven’t tested it just yet so if it doesn’t work then you can reply to me saying so):

-- << Mouse Image Label >> --
local mouseCursor = {Reference The Custom Image Label Containing The Mouse}

-- << Services >> --
local userInputService = game:GetService("UserInputService")

-- << Main Event >> --
userInputService.TouchMoved:Connect(function(touch, processed)
    if not processed then
        mouseCursor.Position = UDim2.new(0, touch.Position.X, 0, touch.Position.Y)
    end
end)
4 Likes

So what if the player was in first person will the mouse be in the middle

2 Likes

No, the script I provided will not put the mouse cursor in the middle if a mobile player is playing in first person. If you want the mouse cursor to be in the middle of the screen if the player is in first person, you can add a condition to check if the player is in first person and set the position of the ImageLabel to be in the middle.

Well thank you for your advice