So I’m working on a mobile game made of nothing but UI. However, when I went to test mobile all buttons are non-existent. I did remove the starter player and character scripts if that would have something to do with it. If possible I would like to get the joystick back without getting the starter scripts back.
It appears that the movement buttons do not appear if there is no character spawned in. You can spawn in the character or make sure game.Players.CharacterAutoLoads is enabled.
Wait… Is there a way to get this button/joystick position from another script if i created it with one?
Because the script was inside the player object, (The reason it didn’t show up)
I made a mobile button, And it works… But can I make a joystick
local contextActionService = game:GetService("ContextActionService")
function onButtonPress()
game.Workspace.Baseplate:Destroy()
end
local mobileJoystick = contextActionService:BindAction("MobileMovement", ,true,"d")
contextActionService:SetPosition("MobileMovement",UDim2.new(0.72,-25,0.20,-25))
contextActionService:SetImage("MobileMovement","http://www.roblox.com/asset/?id=68437731")
No, you would need to do a bit more, as not only are you clicking the joystick, you are making it move around with the finger and all that. It’s doable, though.
It is built in, but it doesn’t appear when there is no character. You may be able to find the scripts for the buttons if you look around in the game explorer.
Otherwise, here is a link with some useful phone input stuff.
So I just fixed it by adding the starter scripts back into the game but not the starter character, I just removed the jump button from the code. Thank you for your help, but I think I’m ok from here on!