08 / 13
Packages/Projectile Toolkit Pro/Mouse, touch & drag aiming
INPUT & INTEGRATION
08 / 13

Mouse, touch & drag aiming

Choose an input owner and connect click, touch, slingshot or gamepad controls.

English guideSource: Unity 6000.3.13f1 · URP 17.3.0 · Windows Editor / DX12Web edition · 22 October 2026

Choose one input owner for each aiming gesture. The built-in launcher input is a quick way to prototype; an explicit adapter gives your game UI or input code control.

Mouse and touch aiming#

Built-in Mouse/Touch input converts a screen position onto an aiming plane and fires on click or tap. Assign the correct camera and plane for the game. A 2D setup normally uses the XY plane; a top-down 3D setup can use a horizontal plane.

In the supplied 2D Playground sample, clicks inside the cannon's swept muzzle reach preserve the previous aim and do not fire. That is a sample safety rule; it does not restrict calls to LaunchAt.

Drag to aim#

  1. Enable Drag to Aim. Use Reverse Drag for a slingshot that launches forward when the player pulls backward.
  2. Set the minimum and maximum drag distances and the Drag Power Scale.
  3. Press, pull and hold to aim. Release a valid gesture to queue one shot. A click or a drag below the threshold does not fire.
  4. Read CurrentDragOffset for a bounded pouch/cable visual. It is the physical pull, not the potentially distant CurrentAimPoint.

The supplied slingshot example uses a 2.4-unit maximum drag and pull visual. Half pull stretches the pouch by 1.2 units; extra drag cannot stretch it farther.

Use your own input or UI#

CanvasAimArea sends pointer/touch drag events to PointerAimInput. Disable the polling input component when that explicit UI area owns the same gesture, so the same touch is not handled twice. The optional Input System integration is separate from the base workflow.

Use SetInput with an IProjectileInput adapter, SetGamepadAim for your gamepad adapter, CancelAim to cancel the current gesture or ResetAim to clear retained aim state.

Adapted from the supplied guide · PDF pages 8.View source guide ↗
Keep creating.ERAGAN STUDIO.

Search a topic, setting or method across all package guides.