Lock NPC Camera Bound
Lock the camera around an NPC
Fields
| Field | Type | Default | Description |
|---|---|---|---|
interruptTriggers | List<Ref<TriggerableEntry>> | empty | — |
npc | Ref<out EntityInstanceEntry> | — | The NPC instance to use as camera focus. Leave empty to reuse the interacting NPC from the context. |
offsetX | Var<Double> | 0.0 | Horizontal offset (X axis) relative to the NPC position. |
offsetY | Var<Double> | 0.0 | Vertical offset (Y axis) relative to the NPC position. |
offsetZ | Var<Double> | 0.0 | Horizontal offset (Z axis) relative to the NPC position. |
lookOffsetX | Var<Double> | 0.0 | Horizontal offset (X axis) for the point the camera should look at. |
lookOffsetY | Var<Double> | 0.0 | Vertical offset (Y axis) added on top of the NPC eye height for the look at point. |
lookOffsetZ | Var<Double> | 0.0 | Horizontal offset (Z axis) for the point the camera should look at. |
pitchOffset | Var<Float> | 0 | Additional pitch offset (in degrees) applied after looking at the NPC. |
relativeToNpcRotation | Boolean | true | Rotate offsets based on the NPC yaw so X/Z offsets are relative to its facing direction. |
fallbackPosition | Optional<Var<Position>> | — | Optional fallback location when the NPC display is unavailable. Defaults to the player's current position. |
Common TypeWriter fields (criteria, modifiers, triggers)
| Field | Type | Default | Description |
|---|---|---|---|
criteria | List<Criteria> | empty | — |
modifiers | List<Modifier> | empty | — |
triggers | List<Ref<TriggerableEntry>> | empty | — |
How to use it
Use it as a bound of a dialogue or interaction. The player's camera is placed at offsetX, offsetY, offsetZ from the NPC and looks at the NPC's eyes plus lookOffsetX, lookOffsetY, lookOffsetZ. With relativeToNpcRotation on, the offsets follow the direction the NPC faces. Leave npc empty to use the NPC the player is talking to. If the NPC is not displayed, the camera uses fallbackPosition or the player's own position.