hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
62 lines (30 loc) • 1.07 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [PlayerCamera](./server.playercamera.md) > [setAttachedToPosition](./server.playercamera.setattachedtoposition.md)
## PlayerCamera.setAttachedToPosition() method
Attaches the camera to a world position.
Use for: fixed cameras or cinematic shots. Do NOT use for: tracking a moving target; use `PlayerCamera.setTrackedPosition`<!-- -->.
**Signature:**
```typescript
setAttachedToPosition(position: Vector3Like): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
position
</td><td>
[Vector3Like](./server.vector3like.md)
</td><td>
The position to attach the camera to.
\*\*Requires:\*\* Player must be in a world.
\*\*Side effects:\*\* Emits `PlayerCameraEvent.SET_ATTACHED_TO_POSITION`<!-- -->.
\*\*Category:\*\* Players
</td></tr>
</tbody></table>
**Returns:**
void