Easy Mobile Buttons - ContextActionUtility

image

how to fix this problem, because my game dont have jump button

1 Like

I have afunction that I will want to run if pressed how do I do that? and not hold

Also it’s only running the function if InputEnded rather than Input began

Pls make it where I can make custom positions

Nevermind I just modded it so I no longer need it

1 Like

What did you end up doing? I am trying to look for nice-looking solutions for custom mobile UI.

You are not a programmer if you cant figure this out :pray:

To anybody stumbling upon this, this is NOT the best way to go around the hardcoded JumpButton limitation. Here’s how you do it:

  1. Make a test ContextActionUtility bind that will generate a button.
  2. When ingame, type JumpButton and locate it.
  3. Copy all of TouchGui
    image
  4. Stop the game, paste it into StarterGui and change its name. (Otherwise CoreScripts will delete it automatically.)
  5. Delete DynamicThumbstickFrame
  6. Make JumpButton invisible by setting it’s ImageTransparency. Make sure Active and Interactable are false as well, to avoid any unwanted side effects.
  7. Modify the ContextActionUtility module to point to the new UI you just made.
    image
    image

There you go. No need to play with the core scripts! (I know this is an old post lol)

Bro’s asking for help and you’re out here being rude :pray: :sob:

1 Like

Because the buttons that this module creates are parented under the JumpButton.


image

Change the line:

local function BindButton(actionName, functionToBind)
	local button
	local slot
	local data = Buttons[actionName]
	if data then
		print("is Data")
		if data.Connections then
			print("is Connections")
			DisconnectButton(actionName)
		end
		if data.Slot then
			print("is Slot")
			slot = data.Slot
		else
			slot = GetNextSlot()
		end
		if data.Button then
			print("is Button")
			button = data.Button
			button.ImageColor3 = button.BackgroundColor3
			local title = button:FindFirstChild("title")
			if title then
				title.TextColor3 = button.BackgroundColor3
			end
		else
			button = newDefaultButton(actionName, slot)
		end
		
	else
		slot = GetNextSlot()
		button = newDefaultButton(actionName, slot)
	end
	
	button.Parent = JumpButton
        -- CHANGE TO: button.Parent = JumpButton.Parent
	
	Buttons[actionName] = {["Name"] = actionName, ["Button"] = button, ["Slot"] = slot, ["Connections"] = {}}
	ConnectButton(actionName, functionToBind)
end

Do note that this’ll obviously affect the current positioning and sizes of the custom buttons. Just change the button size to match on both axes (the default jump button is {0, 120},{0, 120}), and update the position to your liking.