---
url: https://cri-middleware.github.io/SSPlayerForWeb/api/@spritestudio/ssplayer-pixi-ui/classes/SSPartFollower.md
---
# Class: SSPartFollower\<T>

Defined in: packages/ssplayer-core/dist/index.d.ts:5389

Drives external objects to follow animation parts — a weapon in a hand, an
effect on a muzzle, a hitbox on a null part.

The host owns when to call [update](#update): it must run after the frame's world
matrices are final, which is the only moment `getPartTransform` describes the
frame about to be drawn.

## Type Parameters

### T

`T`

## Constructors

### Constructor

> **new SSPartFollower**<`T`>(`source`, `host`): `SSPartFollower`<`T`>

Defined in: packages/ssplayer-core/dist/index.d.ts:5396

#### Parameters

##### source

[`SSPartFollowSource`](../interfaces/SSPartFollowSource.md)

##### host

[`SSPartFollowHost`](../interfaces/SSPartFollowHost.md)<`T`>

#### Returns

`SSPartFollower`<`T`>

## Accessors

### size

#### Get Signature

> **get** **size**(): `number`

Defined in: packages/ssplayer-core/dist/index.d.ts:5398

How many targets are currently following a part.

##### Returns

`number`

## Methods

### attach()

> **attach**(`part`, `target`, `options?`): [`SSPartAttachment`](../../ssplayer-webgl/interfaces/SSPartAttachment.md)<`T`>

Defined in: packages/ssplayer-core/dist/index.d.ts:5408

Make `target` follow `part` (a name or an index). Attaching a target that
is already attached replaces the earlier attachment rather than stacking a
second one. With position, rotation and scale all enabled the full affine
is written, so a mirrored part is reproduced exactly. A part's own skew is
a non-inheriting local-vertex deform kept out of the world matrix, so it
never reaches the follower (matching SpriteStudio, where skew does not
propagate to children).

#### Parameters

##### part

`string` | `number`

##### target

`T`

##### options?

[`SSPartFollowOptions`](../interfaces/SSPartFollowOptions.md)

#### Returns

[`SSPartAttachment`](../../ssplayer-webgl/interfaces/SSPartAttachment.md)<`T`>

***

### detach()

> **detach**(`target`): `void`

Defined in: packages/ssplayer-core/dist/index.d.ts:5410

Stop following for `target`, reversing the parenting and visibility we imposed.

#### Parameters

##### target

`T`

#### Returns

`void`

***

### detachAll()

> **detachAll**(): `void`

Defined in: packages/ssplayer-core/dist/index.d.ts:5412

Detach every target — for teardown, so nothing is left hidden or reparented.

#### Returns

`void`

***

### update()

> **update**(): `void`

Defined in: packages/ssplayer-core/dist/index.d.ts:5414

Drive every attachment to its part's transform on the current frame.

#### Returns

`void`
