How would I only enable mouse input to go on gui not the object behind gui

I tried to make placement system that when I click the gui button, you can place the object and can edit the object when you click it, after you have placed it

But the problem is that object behind the gui also gets mouse input if there is any when you click button.

I only want to make my mouse input go on gui, not the object. How would I make this happen?

-vid-
https://streamable.com/zwd0dg

Use ContextActionService to bind and unbind actions

2 Likes

I don’t really get how I would use ContextActionService to stop this, could you explain bit more please?

nevermind, I figured out the solution with alternative way using mouse.enter and mouse.leave