So, I was wondering, How do I make a car work for PC AND mobile? Like GreenVille, if you check their car driving style i’m kind of aiming for that. But they have a script that for PC it shows no GUI’S in the car because they can just click WASD to move. While the Mobile Players need a GUI because it wont operate for them since they don’t have WASD, any idea on how to script this?
I’m rlly sorry. I’m not too skilled with this stuff. I’m not sure why it’s not working but I know the default way to make vehicles does work with mobile
I think you could use contextbindservice, More specifically the “ContextBindAction” function, It allows you to bind both pc and mobile controls to an action such as driving.
Roblox shows the following code:
local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function ()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function ()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)