In Godot, achieving smooth scrolling within a ScrollContainer while dragging items requires a few steps to handle drag events. When you drag a slot inside a ScrollContainer, you can trigger the scroll action based on the drag position.

Here’s a simple way to do it:

  1. Ensure ScrollContainer is set up properly: Your container should have its scroll_h and scroll_v properties enabled to allow scrolling.
  2. Handle Dragging: Use InputEvent to detect when a drag event occurs. You can add a condition to detect the drag direction and adjust the container’s scroll offset accordingly.
  3. Use the set_offset() method: Inside the drag event handler, use set_offset() to move the scroll position dynamically as the drag happens.

By implementing this functionality, you create a seamless scrolling experience in your Godot UI while dragging items within a ScrollContainer.