Gui blocking me from turning camera

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I have an invisible button the size of the screen
  2. What is the issue? Include screenshots / videos if possible!
    it doesn’t let me rotate the camera
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I set the button to disactive and it still didn’t work. I found GUI blocking me from turning camera but it didn’t have the solution

turn the visible property off and see if it works

I tried but nothing happens when I clicks the button though I can rotate the camera, it’s one or the other

Why do you even have an invisible button the size of the screen? There is probably a better way to do what you are trying to accomplish.

The reason I’m not using mouse.clicked is because I don’t want it to signal when the mouse is hovering a button. Only when it hit’s the screen. I have the button zindex to 0 so the other gui is on top of it

make sure you make visible to false, not transparency to 1

Did that but the button doesn’t work anymore, nothing happens when I click it. There is nothing wrong with my code. The buttton only signals when clicked with visible on

how about making the screengui enabled to false

Instead of making a button like that, just do:

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()

local function onButton1Down()
    -- put whatever you want to happen in this function
end)

mouse.Button1Down:Connect(onMouseClick)

If I used that solution it wouldn’t ignore the gui buttons on the screen

Thats the only way to achieve the effect without breaking the camera as far as I’m aware, but you could add a bool which shows if the mouse is over an object and check that.

You would do something like this:

local hover

guiObject.MouseEnter:Connect(function()
     hover = true
end)

guiObject.MouseLeave:Connect(function()
     hover = false
end)

guiObject2.MouseEnter:Connect(function()
     hover = true
end)

guiObject2.MouseLeave:Connect(function()
     hover = false
end)

--etc.

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