nopo-dev / metroidvania-jam

Made for Metroidvania Jam (19) on itch.io
https://nopo-dev.itch.io/snail-shlapper
0 stars 0 forks source link

cinemachine confiner/camera bounds #40

Open nopo-dev opened 1 year ago

nopo-dev commented 1 year ago

janky in places, can modify map/camera bounds for less weird snapping and better tracking for small rooms. idk what the issue is there,

nopo-dev commented 1 year ago

i think i know how to fix this

  1. remove pixel perfect component from main camera
  2. ensure main camera has projection > orthographic selected
  3. remove confiner 2d component from cinemachine
  4. add cinemachine confiner extension to cinemachine, uncheck confine screen edge, set confine mode to confine 2d, select camera bounds as the bounding shape 2d
  5. add cinemachine pixel perfect extension to cinemachine
  6. edit ortho size on cinemachine to get proper viewing distance
  7. modify camera bounds collider to restrict where the camera center is allowed to go

fixed prefab and camera in previous rooms

nopo-dev commented 1 year ago

TODO: delete polygon collider from camera bounds, add multiple box colliders and composite collider to contain camera note that these will contain the camera center, not its edges