Any way to change input priority?

I have some buttons where I handle specific actions for each button inside ClickDetector | Roblox Creator Documentation and handle other generic actions for all buttons inside UserInputService | Roblox Creator Documentation :

MyButton.MouseButton1Click:Connect(MyButtonClick)

UserInputService.InputBegan:Connect(function(Input, GPE)

The problem, in this case, is that UserInputService.InputBegan will always be fired BEFORE MouseButton1Click:Connect.

Is there a way to invert this priority?

As far as I know, only RenderStep connections can be set to a specific priority. Connections, such as MouseButton1Click and InputBegan run at a set priority. You may have to search for an alternate solution for what you’re trying to accomplish here.

1 Like

Don’t know if this could help, though I believe you can use RunService:BindToRenderStep() to change priorities. Like @itsLevande said, you’d have to use RenderStepped for this, I don’t think you can just change the connection’s priority.
Learn more here:
https://developer.roblox.com/en-us/api-reference/function/RunService/BindToRenderStep

1 Like

Thanks, but I didn’t understand how this could help me get MouseButton1Click:Connect fired before UserInputService.InputBegan…

Like I said, I do not think there is a way you can do that with connections. At least, I don’t know of a way. You would have to use RenderStepped for this.