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.
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