Moving cursor while inside first person, Modal trick doesn´t work anymore

Hey guys,

I got into a problem because I heard that you can use textButton and set its property to modal and in first person you can use your cursor and use it normally like you would do in 3rd person but now it for some reason doesn´t work. I have tried setting inputService.MouseBehavior.Enum == Enum.MouseBehavior.Default and .LockCenter. But these just dont work for me and i don´t know how to make it work.

I have seen that you should just use a TextButton inside a ScreenGui, make it visible, make the position and scale of it to (0,0). And it worked but today it suddenly stopped working and I want to know if I am the only one or what has happened.

local InputService = game:GetService("UserInputService")

InputService.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.LeftAlt then
        script.Parent.Enabled = not script.Parent.Enabled
    end
end)

Thanks for help.

1 Like

For Modal property to work the button has to be visible. When you make its Size (0, 0) the modal won’t work. Instead just make the button small and set its BackgroundTransparency to 1.

2 Likes

Oh mate, thank you so much I really don´t know why it stopped working because it worked till today, but thank you it works now!

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