GameProcessed Event

What are its uses? I saw in the docs that it was used for ui buttons and contextaction inputs, but aren’t there already lines of code in engine that look for when a button is pressed or input is done?

11 Likes

gameProccessedEvent just means that the Game has observed the input and has acted upon it

If so, it returns true

https://create.roblox.com/docs/reference/engine/classes/UserInputService#InputBegan

3 Likes

Basically say you have an .inputBegan event set ip to listen for the player’s clicks for a specific thing to happen, well what if the player doesnt want the specific thing to happen and just clicks in the chat, this is where GPS comes into play, it returns false if he didnt click at anything, it returns true if he clicked for example a clickDetector or a clickable UI element, so basically you can check if the GPS value is equal to false so you can safely say the player has intended to do that.

3 Likes

Is it just like a double check if a player has done something then?

You could think of it like this:

A player can use an ability by pressing E, but if the player types something in chat containing the letter E, we’d want to ignore that.

GameProcessedEvent allows us to ignore situations such as that, and many other cases.

34 Likes

Ah, thanks for clarifying. I assumed it would act like how context action would when looking if a certain action was done.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.