Skip to content

putbacksocketinteractor

eisclimber edited this page Apr 4, 2026 · 1 revision

PutBackSocketInteractor

Class in ExPresSXR.Interaction.Interactors

Inherits from HighlightableSocketInteractor

Summary

An Expansion of the HighlightableSocketInteractor to restrict access to a single GameObject an instance of the putBackPrefab. After a certain amount of time outside the interactor and not being held or selected elsewhere, the object will be snap back to this socket.

The putBackPrefab will be automatically be instanced. If it does not have a XRGrabInteractable-Component and allowNonInteractables is true it will be instanced at the attach point of the socket but won't be able to be interacted with. If the component is missing and the non-interactables are disallowed the putBackPrefab will be set to null.

If the socket does not hold an object, it will be disabled.

The socket and putBackPrefab can be controlled by an Exhibition Display or any other component by setting externallyControlled to true. This will lock "PutBack" section of the sockets editor, as it is controlled elsewhere.

public class PutBackSocketInteractor : HighlightableSocketInteractor

Fields

Name Description
OnPutBack Emitted once an interactable has been put back automatically, but not by placing it back into the socket manually.

Methods

Name Description
ArePutBackReferencesValid() Checks if all references derived from the putBackPrefab are valid.
CanHover(IXRHoverInteractable) Determines if a XRGrabInteractable can hover, i.e. is considered a valid target.
Can be overwritten, but base.CanHover(interactable) should be called to ensure correct behavior.
CanSelect(IXRSelectInteractable) Determines if a XRGrabInteractable can be selected, i.e. is considered a valid target.
Can be overwritten, but base.CanSelect(interactable) should be called to ensure correct behavior.
ForceClearPutBackInteractable() Forces the deletion of the putback interactable instance.
UpdatePutbackAttachCompensation() Used internally to update the attach compensation.
UpdatePutBackObject(bool) Updates the putBackPrefab by destroying and creating instances, adding/removing listeners and de-/selecting the interactable.
Will be automatically called when setting putBackPrefab.

Properties

Name Description
AllowNonInteractables If enabled GameObjects without an XRGrabInteractable-Component will be allowed to be set as putBackPrefab.
Otherwise the provided prefab will be set to null.
CompensateInteractableAttach Compensates the attach off set of the putback interactable.
Makes placing interactables with an attach easier but requires an attach transform to be set.
DestroyIfNotSelecting Destroys the PutbackObject if it gets removed even if the socket is currently not selecting it.
DisableRetainTransformParent Will set the 'Retain Parent Transform' property of the interactable to false to disable a warning regarding it.
ExternallyControlled Hidden in the editor!
Used to disable certain fields in the editor when controlled by an Exhibition Display.
OmitInitialSelectEnterEvent Prevents emitting the initial OnSelectEnter event after the socket is activated.
OmitInitialSelectExitEvent Prevents emitting the initial OnSelectExit event after the socket is activated.
PutBackInteractable The current interactable of the putBackPrefab. Can not be changed via the editor.
May be null if the putBackPrefab has no XRBaseInteractable-Component and allowNonInteractables is true.
PutBackObjectInstance The current instance of the putBackPrefab. Can not be changed via the editor.
PutBackPrefab The prefab that is displayed at the socket. Will automatically create an instance of the prefab and update the references.
PutBackTime The duration in seconds how long the put back object can be unselected outside the socket until being snapped back to the socket.
If less or equal to 0, the object will snap back instantaneous.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally