MapCameraProps
What a scene’s map camera takes: how near and how far its zoom goes, as
the third-person camera’s minDistance and maxDistance say it.
Properties
Section titled “Properties”| Property | Type | Default value | Description |
|---|---|---|---|
bounds? |
MapCameraBounds |
undefined |
Metres east and south the ground point may pan, so a pan by the keys or a drag stops at the edge, the keys’ easing gliding to it; the whole map where unset. A target box, as camera-controls’ setBoundary holds one: a view tilted toward the horizon still shows past it. |
deadZone? |
number |
0 |
The share of the screen, from its middle to its edge, the followed target may wander before the camera moves after it: 0 holds it in the middle, as Diablo’s camera does, and 0.5 lets it walk the middle half, as Cinemachine’s Dead Zone, which also measures the screen. Camera2D’s deadZone measures metres instead, since its view keeps one size; a map camera’s zoom would change a box in metres’ share of the screen. |
follow? |
"player" | ViewTarget | null |
null, so the keys pan and nothing is followed |
What the camera keeps in view: the player’s view target, as the third-person camera’s follow names it, or none. While it walks out of the dead zone the ground point moves with it each frame, holding it on the zone’s edge, and a jump, as a respawn, moves the view there at once. A drag still pans, and the camera leaves alone a target that stands still, so a pan away holds until it moves. The movement keys walk the target rather than pan, as a camera that follows the character the keys walk cannot pan on them too; Q and E still turn. |
maxDistance? |
number |
600 |
Metres from the eye to the ground point at the furthest zoom. The devtools’ Map flight moves it out to where the whole map shows. |
minDistance? |
number |
4 |
Metres from the eye to the ground point at the nearest zoom. |