read the documentation here
github.com/SalmanShhh/C3Addon_Drag-N-Drop/blob/main/Guide.md
You can support me via
- patreon.com/c/SalmanShh
- paypal.com/paypalme/SalmanShh
- ko-fi.com/salmanshh
The problem this addon solves
The built-in Drag & Drop behaviour bakes the mouse and touch connection into its engine. The moment you need gamepad dragging, a hold-to-pick-up gesture, a custom drag handle, or a VR pointer, you fall back to hand-built logic: per-frame Set X and Set Y events, instance variables tracking velocity for a throw, and a per-object "is dragging" boolean copied across every draggable type. Stopping an object being dragged through a wall, snapping it to a grid, or tearing a stuck object free all mean writing distance and overlap maths by hand every frame.
Drag N Drop replaces that with two actions, Start Drag and Drop, that you fire from any event, plus a Set Drag Point action you call each tick to steer the object. Snapping to targets is a radius plus a list of snap points. Auto-dropping an object that gets yanked too far is one action with a distance and a choice. Throw velocity is measured for you and returned when the object drops.
Scenarios Where This Addon Excels
- Gamepad and controller-driven UI: Start and stop dragging from a controller button. The drag point comes from a virtual cursor or joystick, with no mouse anywhere in the chain.
- Hold-to-grab interactions: Adventure, puzzle, and VR-style interfaces where picking something up is a held gesture you control, not an instant click.
- Physics-sandbox and throwing games: Throw velocity is measured automatically, so flick-to-throw needs no per-frame accumulator.
- Snap-to-grid and magnetic slots: Inventory slots, jigsaw boards, and node editors where pieces pull toward and lock onto targets. Snapping and magnetism handle it with a radius and a strength.
- Yank-to-release interactions: Give the object a follow speed so it lags, then flick the cursor away and it auto-drops or cancels once the gap grows past a break distance, with no distance maths.
- Tile-grid editors and builders: Set the follow mode to Grid and the object snaps cell to cell as you drag, landing exactly on a tile. Level editors, city builders, board games, and even step sequencers (with the grid axes mapped to time and pitch) get clean alignment for free, no rounding maths in your events.
- Springy, juicy dragging: Spring Physics mode ties the object to the cursor with a tunable spring, so it overshoots and settles like a rubber band. Perfect for satisfying mobile UIs, wobbly creatures, slingshots, and pull-and-release charge mechanics, with the throw measured from the object's own velocity.
- One behaviour, four feels: Switch between Instant, Constant Speed, Spring Physics, and Grid at runtime with a single action, so the same object can snap precisely, glide, bounce, or grid-lock depending on context, like a power-up, a settings toggle, or a status effect changing how it drags.
- Puzzle games at scale: Dozens of draggable pieces, each respecting direction locks, all sharing one behaviour configuration.
- Accessibility-driven input: Switch-access, eye-gaze, or dwell-click systems can start and stop drags from any event without touching the object's drag logic.