Skip to content

AttachmentPoint

A slot that accepts and manages an attached object through configurable state processes.

Namespace: Octoputs.Core
Inherits: JungleBehaviour → MonoBehaviour

Overview

AttachmentPoint defines a position where an AttachableObject can be placed. It controls the full attach/detach lifecycle on the receiving side, running its own attaching, attached, and detaching processes in parallel with the object's. Supports cancellation strategies (Pause or Revert), instant steal from other points, and condition-gated transitions.

To tag a point for filtering, add a Tagger component to the same GameObject and assign Key assets. Then use a GameObjectFilterAttachmentPointCheck with a JungleTagFilter on the object or agent to enforce matching.

Properties

Property Type Description
initialAttachable SmartAttachableObject Object that is already on this point when the scene starts. Snaps straight to attached on Start, skipping the attaching animation. Leave empty for a point that starts free.
attachableFilters List<IAttachableObjectCheck> Checks an attachable must pass to attach here (added directly — no umbrella wrapper).
attachConditions List<Condition> Conditions required to attach an object.
attachCancellation CancellationStrategy Strategy when attach is cancelled: Pause or Revert.
attachingProcess IProcess Process that runs during the attaching phase. Defaults to a direct transform operation.
onAttachStarted UnityEvent<AttachableObject> Invoked when an object starts attaching.
attachedProcess IProcess Process that runs while an object is attached.
onAttached UnityEvent<AttachableObject> Invoked when an object is fully attached.
detachConditions List<Condition> Conditions required to detach an object.
allowInstantSteal bool When true, other zones can instantly grab the attached object without waiting for detachment.
detachCancellation CancellationStrategy Strategy when detach is cancelled: Pause or Revert.
detachingProcess IProcess Process that runs during the detaching phase.
onDetachStarted UnityEvent<AttachableObject> Invoked when an object starts detaching.
onDetached UnityEvent<AttachableObject> Invoked when an object finishes detaching.

Runtime State

Member Description
IsHolding true while the point holds an object (any phase except Idle).
AttachedObject The currently-bound attachable (null if Idle).
CurrentPhase Idle / Attaching / Attached / Detaching.
IsPaused true when an attach or detach is paused (Cancel called with Pause strategy).
IsDetachInProgress Shorthand for CurrentPhase == Detaching.
CanAcceptAttachable(attachable, out reason) True if the attachable passes filters + conditions, ignoring whether the point is currently free. reason describes the first failure.
CanAttach(attachable, out reason) True if the point is free AND the attachable is valid.
CanDetach() Evaluates the detach conditions wired in the Inspector.

Public Methods

Method Description
Attach(attachable, onComplete = null) Begin attaching attachable. Runs the attaching process, then invokes the callback when phase reaches Attached.
InstantAttach(attachable) Same effect, skipping the attaching state process.
Detach(onComplete = null) Begin detaching the held object. Runs the detaching process, then invokes the callback when phase returns to Idle. Callbacks are queued if a detach is already in progress.
InstantDetach() Force-complete any in-progress attach/detach to Idle immediately. Also runs on OnDisable.
TryDetach() Detach only if CanDetach() passes. Returns true if a detach started.
CancelAttach() / CancelDetach() Pause or revert the in-progress phase (chooses based on the matching CancellationStrategy setting).
ResumeAttach() / ResumeDetach() Resume from a paused state.

For copy-paste C# usage of these members, see Scripting API Examples.

See Also