Make a user unable to move when in a UI

Hello,
How can I make it so that when a user is in a UI, they cannot move?

1 Like

Just set their WalkSpeed to 0 or anchor their HumanoidRootPart. Anchoring is probably best just incase your game modifies WalkSpeed

1 Like
UI:GetPropertyChangedSignal('Enabled'):Connect(function()
    if UI.Enabled then
        Player.Character.Humanoid.WalkSpeed = 0
    else
        Player.Character.Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
    end
end)
2 Likes