Hey, so recently I adjusted my function to be bound using two different UserInputTypes using ContextActionService, I added in the Touch input type for it to be compatible with mobile input.
However, I’ve heard reports of the mobile camera not being responsive to touches after making this change…
Can you only have one type of user input bound to a single action at a time??
Either that, or this is potentially an engine bug.
Like literally resetting the CurrentCamera to Custom which will automatically reset the LocalPlayer or desired player’s camera to their client settings.
AKA normal camera
while wait() do
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Custom
wait(seconds)
end
Put that maybe in a localscript in starterplayerscripts. Tweak it however you want. waits for abuse about using while wait() lol
The last argument of any of the ContextActionService bind methods is a tuple for which input types or key codes should run the action. You can have as many types of input or key codes trigger actions as you would like. This is apparent in the API pages. BindAction, for example, has this information.
local ContextActionService = game:GetService("ContextActionService")
local function testFunction()
print("Run")
end
ContextActionService:BindAction("Test", testFunction, false,
Enum.KeyCode.E, Enum.KeyCode.F, Enum.KeyCode.G, Enum.UserInputType.TouchTap)
* Excuse the new line I put the types on, that was just to show. I don’t actually do it like that. I would probably have a table that I unpack or write out the input triggers on one line.
Thanks for the info. I’m really puzzled, as the code I wrote for the tool has nothing to do with the camera, and if there isn’t an issue with having multiple of the same input type bound to different functions, I can’t see how that’s causing an issue…
I’ll try running a loop that’ll update the player’s camera, so hopefully that does the trick.
if you bind multiple functions to the same UserInputType then only the latest bound function will be called. but this can be bypassed if you return Enum.ContextActionResult.Pass in the function you bind.
function danceMonkey()
print("the camera can move")
return Enum.ContextActionResult.Pass -- makes it so that the next function (camera touch movement) gets to be called
end
contextActionService:BindAction("danceforme", danceMonkey, false, Enum.UserInputType.Touch)