I am making an endless runner where I generate obstacles on the bottom right corner of the screen right above the platform the player is running on.
What I am trying to do is position the obstacles relative to the camera so that, no matter what screen size the game is played on, the obstacles are always appearing at the appropriate position at the bottom right.
I’m unsure about grabbing a reference to the camera, I currently have:
Camera camera = Camera.main;
I’m not sure where to go from there and how to get the desired result. Any help is much appreciated!
P.S. Please correct me if this isn’t the proper way of doing this.