Modal doesn't work if i do these steps

Okay, let’s start with my game. My game is first person horror game. Which has some frames which I want the mouse to move.

Modal is the perfect choice for me to use. But if i do these steps Modal stops working.

  • Set StarterPlayer CameraMode to LockFirstPerson.
  • Make a ScreenGui and set the IgnoreGuiInSet to True.
  • Make a Button inside the ScreenGui and set the Modal to True.

But I want these steps done for my game but still Modal becomes unuseable.

Can you show us the script you are using?

-- Here the shop system/animation takes place. By the help of UiTrigger Event.

-- Services
local localPlayer = game:GetService("Players").LocalPlayer

-- Event
local ShopUiEvent = game:GetService("ReplicatedStorage").Events.UiTrigger

-- Instences
local PlayerGui = localPlayer.PlayerGui
local frameShop = PlayerGui:WaitForChild("Screen").Shop
local frameHotbar = PlayerGui:WaitForChild("Screen").Hotbar
local ExtButton = PlayerGui:WaitForChild("Screen").ShopExit

-- Values
local Cash = localPlayer:WaitForChild("Stats").Cash
local FoodHealth = localPlayer:WaitForChild("Stats").Food
local Electricity = game:GetService("ReplicatedStorage").Global.Electricity

local actionNameS

ShopUiEvent.OnClientEvent:Connect(function(actionName)
	actionNameS = actionName
	if frameShop.Visible ~= true then
		frameShop.Visible = true
		frameHotbar.Visible = false
		ExtButton.Visible = true
		localPlayer.Character.HumanoidRootPart.Anchored = true
		ShopUiEvent:FireServer(actionName, false)
	end
end)

ExtButton.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType ==  Enum.UserInputType.Touch then
		ExtButton:TweenSize(UDim2.new(0.025, 0,0.04, 0),nil,nil,0.1,true)
	end
end)

ExtButton.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType ==  Enum.UserInputType.Touch then
		ExtButton:TweenSize(UDim2.new(0.03, 0,0.05, 0),nil,nil,0.1,true)
		frameShop.Visible = false
		frameHotbar.Visible = true
		ExtButton.Visible = false
		localPlayer.Character.HumanoidRootPart.Anchored = false
		ShopUiEvent:FireServer(actionNameS, true)
	end
end)

Welp let me make this easy for you, The script doesnt to anything else then visibling the button and disableing when clicked!

So you’re trying to make the mouse be able to move over the button in first person? Add this to your script somewhere.(GuiButton | Roblox Creator Documentation)

local gui = -- ur gui
gui.Modal = true
1 Like

Doesnt work, I defaulted the Modal but used your method also.

1 Like

If I disable IngoreGuiInset It works but doesnt work when its enabled.

Where did you add it in? I don’t see why it wouldn’t be working, can I see your explorer layout?

Capture

1 Like

Very odd, seems to be working for me even when I have IgnoreGuiInset enabled

1 Like

I got the problem! I was using cameraType to Fixed but I shoud’ve used the Custom one.

1 Like