---
url: https://cri-middleware.github.io/SSPlayerForReactNative/api/functions/useSsPartTransform.md
---
# Function: useSsPartTransform()

> **useSsPartTransform**(`player`, `partName`): `SharedValue`<[`SsPartScreenTransform`](../interfaces/SsPartScreenTransform.md)>

Defined in: [packages/react-native-spritestudio/src/view/useSsPartTransform.ts:47](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/view/useSsPartTransform.ts#L47)

Follows a part with a Reanimated shared value — a health bar over a head, a
spark at a muzzle, a React view pinned to a hand.

Sampled on the JS thread, once per frame the player shows (`player/frames`),
and published into a shared value, so the *consumer* runs on the UI thread
even though the sample does not. A player that stands still shows no new
frame, and is not read. The frame loop, the Brain and the whole player are
JS-thread, so a hook that claimed to sample in a worklet would be sampling a
value the JS thread had already moved on from.

The reported transform is in **view pixels**, root transform applied, because
that is the space an `Animated.View` on top of the canvas lives in.

Position, rotation and scale only — never Skew: a part's Skew is a
non-inheriting local-vertex deform that stays out of the world matrix, so a
follower is not sheared even when it rides a sheared part (or one under a
sheared parent), matching SpriteStudio.

## Parameters

### player

[`SpriteStudioPlayer`](../classes/SpriteStudioPlayer.md) | `null`

### partName

`string`

## Returns

`SharedValue`<[`SsPartScreenTransform`](../interfaces/SsPartScreenTransform.md)>
