What I want to be able to do is bind multiple keys to this one action. So I want if the player clicks, touch (for mobile/tablet) or presses A (gamepad) it to work. I tried doing what I have below for just pc and tablet,
I’m pretty sure this is because there is only one input argument for each BindAction, so to fix it all you have to do is create another one.
local cas = game:GetService("ContextActionService")
local function inputPlace()
-- Code
end
cas:BindActionAtPriority("Place", inputPlace, false, 9, Enum.UserInputType.MouseButton1)
cas:BindActionAtPriority("Place2", inputPlace, false, 9, Enum.UserInputType.Touch)
Yea you’re right and I think I found the solution!
local cas = game:GetService("ContextActionService")
local function inputPlace()
print("test")
end
cas:BindActionAtPriority("Place", inputPlace, false, 9, Enum.KeyCode.Y, Enum.KeyCode.Z)
This works because roblox doesn’t use the Z or Y key for anything in their default scripts when you load the game. I don’t know how you would get it to work with inputs they do use though (Unless you unbind them).