I am working on a game like among us, it is in gui form, is there any way I can detect if the player gui touches a wall or something? I can keep the player in a certain area, but if there is an object within that area, they can go right through it. Here is my current script: (There are other copies that are for different keys)
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local keydown = false
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.W then
keydown = true
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.W then
keydown = false
end
end)
while true do
wait()
if keydown then
if script.Parent.Parent.Floor.AbsolutePosition.Y > 302 then
else
--script.Parent.Position = script.Parent.Position - UDim2.new(0,0,0.005,0)
script.Parent.Parent.Floor.Position = script.Parent.Parent.Floor.Position + UDim2.new(0,0,0.01,0)
end
end
end
Thanks, is there any function that would help me that I should be aware of?

2 comments
Have you tried going through the events list under GuiObject to see if the is a function or event with a name like you Touched?
There is none. I did see a dev forum post that I am going to try though.