How would I make this work for mobile?

my script is

local function bindInputs()
    if (not OVERRIDE_CONTROLS) then
        game:GetService("ContextActionService"):BindActionAtPriority("PlacementModule_Rotate", inputRotate, false, INPUT_PRIORITY, Enum.KeyCode.R)
        game:GetService("ContextActionService"):BindActionAtPriority("PlacementModule_Place", inputPlace, false, INPUT_PRIORITY, Enum.UserInputType.MouseButton1)
    end
end

I want it to work for mobile here

I wanted to do

ButtonR.TouchTap:Connect(function()
    if script.Parent.Value ~= '' then
        OnKeyR_Pressed()
    end

But that doesn’t make sense and idk how to do it :frowning: someone pls help.
and its in a folder called Modules and in the folder is a Module and its named PlacementModule

1 Like

You can use Enum.UserInputType.Touch.

and where would I put this in the script?

Just copy the game:GetService("ContextActionService"):BindActionAtPriority("PlacementModule_Place", inputPlace, false, INPUT_PRIORITY, Enum.UserInputType.MouseButton1) line then add it to the next line after mousebutton1 one and change the last enum to Enum.UserInputType.Touch.

game:GetService("ContextActionService"):BindActionAtPriority("PlacementModule_Place", inputPlace, false, INPUT_PRIORITY, Enum.UserInputType.MouseButton1, Enum.UserInputType.Touch)

like this?

that didnt work it justt makes the ui gone