Quantcast
Channel: Answers for "Keep Top Down 2D camera in bounds of background sprite"
Viewing all articles
Browse latest Browse all 6

Answer by MorphVGX

$
0
0
This is what worked for me to get the limits for the camera position: float camExtentV = _cam.orthographicSize; float camExtentH = (camExtentV * Screen.width) / Screen.height; Bounds levelBounds = LevelBoundsSpriteRenderer.bounds; float leftBound = levelBounds.min.x + camExtentH; float rightBound = levelBounds.max.x - camExtentH; float bottomBound = levelBounds.min.y + camExtentV; float topBound = levelBounds.max.y - camExtentV;

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images