Get UI Button to throw the GameProcessedEvent flag?

I have a placement system in my game that uses the two mouse buttons, MouseButton1 is supposed to cancel placement when pressed. MouseButton1 is also used for clicking buttons. My issue is that I have a button I need to use to toggle a placement, but the placement gets immediately cancelled due to MouseButton1 also being the button for disabling placement. This wouldnt be an issue if clicking on a button set the GameProcessedEvent parameter for the InputBegan event to true. It does not do that for some reason. Any idea how to get around this?

EDIT: UI Buttons do trigger the GameProcessedEvent flag, so the issue im having is something else entirely! Toodles!

You could use a boolean variable that gets set to false when you click the button and when is false, doesn’t let the other MouseButton1 cancel. Then add a tiny delay and you can set it back to true.

You can also create the cancel MouseButton1 connection inside the first MouseButton1 using :Once() (tho i’m not sure if you would want this) or you can just set one of these to MouseButton2.

I ended up doing the debounce like you mentioned above, but it would be nice if we could trigger the GameProcessedEvent flag manually

That’s good. You are kind of right but I don’t think it’s really necessary as you can use a debounce or anything else that I said. You should mark either me or yourself as the solution tho.

I know, i was able to work around it so its not a super issue. It did add a little bit of an awkward footnote to my code though, i prefer to keep things as un-spaghetti and uniform as possible

Then you can try doing the :Once() way, if you aren’t using that cancel MouseButton1 for anything else. Or just leave it like this.

You should make a post in feature requests about triggering the GameProcessedEvent flag manually if you think it would be useful

You can’t trigger GPE by yourself cuz it’s smth like system flag

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