> For the complete documentation index, see [llms.txt](https://fast-studios.gitbook.io/press-e/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fast-studios.gitbook.io/press-e/manual/scripting/interactable/interactable.setdraglocked.md).

# Interactable.SetDragLocked

<mark style="color:blue;">public void</mark> <mark style="color:yellow;">SetDragLocked</mark>(<mark style="color:blue;">bool</mark> <mark style="color:$primary;">isLocked</mark>)

Locks/unlocks **Drag** objects (doors, drawers, etc.).

```csharp
public Interactable interactable;

public void ToggleLock()
{
    if (interactable.DragLocked)
    {
        interactable.SetDragLocked(false);  // unlocked
    }
    else
    {
        interactable.SetDragLocked(true);   // locked
    }
    
    // Or more directly:
    public bool inverseDragLocked = !interactable.DragLocked;
    interactable.SetDragLocked(inverseDragLocked);
    
}
```
