PartActions.follow ​Contract 2.0.0 · package sha256
a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e· generated fromconfigurator-runtime.d.tsbyservices/onsite-scripter/scripts/build-contract-docs.mjs; edit the source, not this file.
Method of PartActions · inherited by Query, Parts, Part · stable · since 2.0.0 · called as session.node(nodeId).follow
follow(target: Query, options?: FollowOptions): () => void;
Rides target (one part: a part or bone) every frame, after animations, until disposed.
Re-binds after reloads. A lifecycle call: immediate. Transient: never stored or undone. Through
Parts, every match follows; use node(nodeId).follow(…) to move a model as a whole. Returns
the stop function. A target that matches several parts applies nothing ('target-ambiguous').
Errors: none thrown; a target matching several parts records 'target-ambiguous' and applies
nothing.
Through Session:
| Option | Type | Default | What it does |
|---|---|---|---|
offset |
'rest' | 'current' | 'none' |
'rest' | 'rest': keep the offset the two parts have in their rest poses (safe to call any time). |
signal |
AbortSignal |
undefined | Aborting stops following; already aborted, none starts (SignalOption). |
Through Tx:
| Option | Type | Default | What it does |
|---|---|---|---|
offset |
'rest' | 'current' | 'none' |
'rest' | 'rest': keep the offset the two parts have in their rest poses (safe to call any time). |
signal |
AbortSignal |
undefined | Aborting stops following; already aborted, none starts (SignalOption). |
signal) ​This call is a creator (SignalOption.signal, the kinds of call).
A creator (
collectionfor a new name,materials.create,on,onFrame,beforeCommit,follow,input.drag,labs.lightLinking) given a signal already aborted returns at once, already ended: aCollectionorMaterialreadingdisposed: truethat holds no content and no live name, or a registration that never runs and whose disposer does nothing.It records no Problem for the abort and throws only what it would throw anyway, as the DOM's
addEventListenerwith an aborted signal adds nothing (spec section 6.5).
Imports: values (has, validate, the Holo*Error classes, the pure helpers) from @holostep-configurators/runtime-client, types from @holostep-configurators/runtime-client/contract, /math and /testing names from those entries; boot from the runtime module the root's loadRuntimeAtFloor resolves to. A type your page defines is your app's: declare it there, never import it from the package.
Compiled under the contract's strict settings (examples/declaration/06-PartActions.follow.ts):
import type { Session } from '@holostep-configurators/runtime-client/contract';
declare const session: Session;
declare const signal: AbortSignal;
declare const pocketId: string;
declare const frameId: string;
// from the base's attributes
declare const pocketFollow: ReadonlyArray<{ source: string; bone: string }>;
for (const { source, bone } of pocketFollow) {
session.find({ node: pocketId, name: source }) // each pocket half…
.follow({ node: frameId, name: bone }, { offset: 'rest', signal }); // …rides its own lid bone
}
| Rule | Result |
|---|---|
| 1. Neutral name | pass: follow names no product |
| 2. A precedent | pass: DOM Document.getElementById (row G31); Unity Animations.ParentConstraint (offsets) (row G6); Unity Animations.ParentConstraint (row K56); Babylon.js TransformNode.attachToBone (row K56) |
| 3. Two apps, or labs | pass: 5 apps (ledger: app-04c2774145, app-b362a81c85, app-c1384707fc, app-f9a32142f1, app-fc306ec3dc) |
| 4. The cheaper fix first | decided per need in Appendix B: rows G31, G6, K56 at tier stable (a member only where no rule, data, asset or app code serves the need) |