Skip to content

Commit

Permalink
Update entity-positioning.md
Browse files Browse the repository at this point in the history
Fixed example code to Attach to other players section

Signed-off-by: Alejandro Alvarez Melucci <[email protected]>
  • Loading branch information
AlejandroAlvarezMelucciDCL authored Feb 19, 2025
1 parent 0f0d09e commit 29f4407
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions content/creator/sdk7/3d-essentials/entity-positioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,15 @@ Using it together with `AvatarAttach`, you could use the following code to add a
```ts
executeTask(async () => {
for (const [entity, data] of engine.getEntitiesWith(PlayerIdentityData)) {
const myEntity = engine.addEntity()
MeshRenderer.setBox(myEntity)
AvatarAttach.create(myEntity, {
anchorPointId: AvatarAnchorPoint.LEFT_HAND,
avatarId: player.userId,
})
}
})
for (const [entity, data] of engine.getEntitiesWith(PlayerIdentityData)) {
const myEntity = engine.addEntity()
MeshRenderer.setBox(myEntity)
AvatarAttach.create(myEntity, {
anchorPointId: AvatarAnchorPointType.AAPT_LEFT_HAND,
avatarId: data.address,
})
}
})
```
See other ways to fetch other user's IDs in [Get Player Data]({{< ref "/content/creator/sdk7/interactivity/user-data.md#get-player-data" >}}).
Expand Down

0 comments on commit 29f4407

Please sign in to comment.