09 / 16
Packages/2D Destruction Pro/Runtime Slice & input
CUT DURING GAMEPLAY
09 / 16

Runtime Slice & input

Assign settings and explicit interactor targets, then send world-space stroke input.

English guideSource: Unity 6000.3.13f1 · Optional Jobs / BurstWeb edition · 21 October 2026

Prepare the runtime object#

Runtime Slice requires supported source geometry: a single convex contour. Manual region support does not extend that runtime requirement. General concave/holey source boundaries, curved cuts and blade thickness are outside the current scope described in the guide.

  1. Select a suitable Sprite GameObject with a SpriteRenderer.
  2. Add the package's Destructible 2D component.
  3. Set Slicing Mode → Runtime.
  4. Create an asset through Create → ERAGANX → 2D Destruction → Runtime Slice Settings, then assign it.
  5. Choose a Material Profile, motion mode and fragment collider type for the scene.

Polygon follows fragment geometry; Box approximates bounds; None disables fragment collider contacts. Use the physics reference to distinguish Rigidbody2D contact response from ballistic motion.

Configure Runtime Slice Settings#

Example values from the supplied capture. Choose budgets for your own scene; Unlimited does not remove geometry or pool limits.

ControlsBound
Maximum Fragments / VerticesActive fragments and generated geometry.
Maximum Cuts / DepthGameplay cut policy and generation depth.
Minimum Area / Width / HeightTiny generated results.
Cut Limit ModeUnlimited or finite gameplay cut-count policies.
Path, speed, impulse and per-frame controlsInput distance, motion and processing budgets.

Read slice budgets before choosing Unlimited or increasing limits.

Assign explicit interactor targets#

Add Runtime Slice Interactor and put the intended destructible objects in its Targets list. Configure stroke force, minimum movement and the object/cut/attempt budgets. The interactor does not search the scene automatically.

The supplied Runtime Swipe capture shows both the interactor and the sample's references. Assign your own targets and world camera.

Send world-space stroke input#

Convert mouse, touch or weapon screen positions to world positions before forwarding them. The guide supplies this contextual flow; interactor is your assigned component reference:

C#
interactor.BeginStroke(worldPressPosition);
interactor.UpdateStroke(worldDragPosition); // repeat while moving
interactor.EndStroke(worldReleasePosition);
// CancelStroke() if input or focus is interrupted.

Use CancelStroke() when focus or input is interrupted. For finite segment cuts, move from outside one edge to outside the other so the segment crosses both polygon boundaries.

Try Samples/RuntimeSwipe/RuntimeSwipe.unity for the current mouse-driven sample, or use the API reference to issue line, segment and path requests directly.

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

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