Search Unity

How do I correct my bounds in 2.5D?

Discussion in '2D' started by davisj16usmc, Jan 27, 2019.

  1. davisj16usmc

    davisj16usmc

    Joined:
    Aug 21, 2015
    Posts:
    21
    I have a 2.5D game (2D game with 3D objects), and I need to detect when the bounds of my 3D objects have reached the edges of the screen. I'm having trouble figuring this out. How do I detect if the outer edge of my 3D object is at the edge of the screen?
     
  2. beanie4now

    beanie4now

    Joined:
    Apr 22, 2018
    Posts:
    311
    Probably set a variable using Screentoworldpoint(Screen.width,screen.height) for the max and screentoworldpoint( 0,0) for the min. (Or something very similar to that) Then on your object just check against this value (make sure you take into account object width) on all 4 sides.