Skip to content
smartargs
VantageDocumentation

Camera reference

Every setting of the top-down camera, with its default and range, and the calls for following, focusing and sharing the scroll wheel. For how to use it, see Camera.

VtTopDownCamera

Component. Add it with Add Component → Vantage → Camera → VtTopDownCamera.

Top-down follow camera with a fixed pitch, scroll-wheel zoom, edge scrolling and middle-mouse panning.

Inspector fields

Target

Field Type Default Range Description
Initial Target (initialTarget) Transform None Optional follow target assigned in the inspector. Assigned to the camera on Start if set. In a game, leave empty and call SetTarget() from your spawn code instead.

Pitch & Height

Field Type Default Range Description
Pitch (pitch) float 58 30 to 89 Downward pitch of the camera in degrees. 58° gives a classic RTS feel.
Default Height (defaultHeight) float 12 Starting camera height above the target on scene load, in world units.
Min Height (minHeight) float 6 Minimum camera height — closest zoom-in.
Max Height (maxHeight) float 20 Maximum camera height — furthest zoom-out.

Zoom

Field Type Default Range Description
Enable Zoom (enableZoom) bool On If disabled, the scroll wheel is completely ignored by the camera.
Zoom Speed (zoomSpeed) float 5 ≥ 0 World units of height change per scroll tick.

Edge Scroll

Field Type Default Range Description
Enable Edge Scroll (enableEdgeScroll) bool On If disabled, mousing near the window edge won’t pan the camera.
Edge Scroll Speed (edgeScrollSpeed) float 20 ≥ 0 World units per second while the mouse sits in the screen-edge band.
Edge Scroll Border (edgeScrollBorder) int 20 0 to 200 Screen-pixel distance from the window edge that triggers edge scroll.

Middle-Mouse Pan

Field Type Default Range Description
Enable Middle Mouse Pan (enableMiddleMousePan) bool On If disabled, holding the middle mouse button won’t drag the camera.
Pan Speed (panSpeed) float 0.5 ≥ 0 World units panned per pixel of mouse movement. 0.5 matches typical RTS defaults.

Input

Field Type Default Range Description
Snap Back Action (snapBackAction) InputActionReference None Re-centres the camera on the target. Empty uses Camera Snap Back from the Vantage input actions, Space by default.

Scripting API

Member Description
static bool IsScrollHeld { get; } True while the scroll wheel does not zoom: an owner holds it with HoldScroll, or IsScrollBlocked returns true.
Transform Target { get; } The current follow target. Null if never assigned.
bool IsInFreeCameraMode { get; } True while the camera is detached from its target (edge-scrolling or panning).
static Func<bool> IsScrollBlocked External predicate — when non-null and returns true, scroll-wheel input is consumed by another system (e.g. rotating a building ghost) instead of zooming.
static void HoldScroll(object owner) Take the scroll wheel away from zooming for owner until ReleaseScroll. Several owners can hold it at once; zoom returns when the last one lets go.
static void ReleaseScroll(object owner) Let go of the hold owner took with HoldScroll.
void SetTarget(Transform newTarget) Assign the transform to follow. Immediately snaps the camera onto the target and exits free-cam mode.
void ResetZoom() Reset the zoom level to defaultHeight.
void SnapToTarget() Re-center the camera on Target (exit free-camera mode).
void FocusOn(Vector3 point) Look at point in free-camera mode, detached from the target. The snap back action returns to the target.