Question by
ido100ido · Mar 17, 2021 at 01:53 PM ·
cameracamera-movementclamppolygon collider 2d
Clamp camera within bounds of a Polygon Collider?
Hi I am making a 2d platformer game and right now I am working on the camera. while I succeeded in clamping the camera inside a rectangular shape, my game involves slopes, so I want my camera to be able to clamp inside a curved shaped too. Can anyone help me find an idea for the code?
Comment
Answer by Fitz28 · Feb 18 at 06:36 PM
So I've been looking into this - I've not yet worked out a 'manual' way of coding this but if you use the Cinemachine & Polygon Collider I think that will work.
video tutorial - https://www.youtube.com/watch?v=izumXk-xoEM