Skip to main content

Grab Controller

NAMESPACEMyDreamGameStudio.InteractAnything
MENU PATHInteraction System > Utilities > Grab Controller
COMPATIBILITYUnity 6.0+
DOC VERSION

The GrabController is the player-side manager for physics-based carrying and throwing. Unlike simple parenting setups that cause items to clip through walls, this controller dynamically calculates velocities in FixedUpdate to pull the object toward a target point. This ensures held items continue to respect world collisions and bounce off door frames naturally.

You only need one GrabController in your scene, typically placed on the Player Rig or Camera.


Editor Interface​

GRAB CONTROLLERPHYSICS CARRYTHROW MECHANICSPlayer-side rig controller for physics-based picking, carrying, and charging trajectories to throw grabbable items.RIG REFERENCES & OFFSETPlayer Camera🎥 MainCamera (Camera)Player Root (Colliders)⬡ Player (Transform)Screen Hold OffsetX0.5Y-0.3ACTIVE INTERACTION GATINGWhile Holding BehaviorBlock Other InteractionsInteract Input Drops HeldPHYSICS FOLLOW DYNAMICSFollow Strength20Max Velocity15Rotation Align Speed10Auto-Drop Distance2Auto-Drop Tolerance0.5THROW AIMINGAim At CrosshairAim Max Distance50Aim Collision MaskEverythingTRAJECTORY PREVIEWTrajectory Line Renderer⎍ Trajectory Line (Line Renderer)Auto-Create MissingDraw Line On Top

Configuration Variables​

Rig References & Offset​

Player Camera
CameraDef: MainCamera
The camera items are held in front of. Defaults to Camera.main if left empty.
Player Root (Colliders)
TransformDef: Player
Colliders under this transform are ignored by the held item while it is carried, ensuring the item cannot push the player.
Screen Hold Offset
Vector2Def: (0.5, -0.3)
Where the item is held in your view. Move it off-center to keep the crosshair and throw preview visible.

Active Interaction Gating​

While Holding Behavior
EnumDef: Block Other Interactions
Determines if the player can interact with other world objects while carrying an item. 'Block' prevents targeting entirely, while 'Drop On Other' automatically drops the held item to press a button.
Interact Input Drops
boolDef: False
Allows pressing the interact key to drop the item even if you are not looking directly at it.

Physics Follow Dynamics​

Follow Strength
floatDef: 20
How strongly the held item is pulled toward the hold point. Higher values feel snappier; lower values add lag and weight.
Auto-Drop Distance
floatDef: 2
If the held item gets stuck behind a wall and exceeds this distance from the hold point for the Tolerance duration, it is automatically dropped.

Throw Aiming & Trajectory​

Aim At Crosshair
boolDef: True
Angles the throw toward the surface under the center of the screen, rather than shooting straight out from the camera forward vector.
Trajectory Line Renderer
LineRenderer
Draws the predicted throw arc. The controller will automatically generate a highly optimized, depth-ignoring material for this if Auto-Create Missing is checked.
Simulation Segments
intDef: 30
The number of physics steps to calculate for the preview arc. Higher numbers draw longer lines but cost more performance.