Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Camera Angle Produces Unfair Advantage

Discussion in 'Editor & General Support' started by mcooper9, Nov 28, 2022.

  1. mcooper9

    mcooper9

    Joined:
    Jun 26, 2018
    Posts:
    3
    Hi all,

    I'm having a problem in a game that I'm making due to the angle of the camera. Players looking parallel to the angle of their camera (or "up"/forward from their current z position) can see players that cannot see them in return.

    I've including a picture with the rough camera angle from the green player perspective. For the blue player's camera, the green player would be off screen (I've marked roughly where the green player would be on the blue players camera at the bottom right.

    Is there any way around this?
     

    Attached Files:

  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,903
    Just as in real life, people see only a part of the world at any time. Any camera that follows a player will benefit that player. There will be other times that Blue has the advantage. The only way around it is for everyone to have the same camera that sees the whole field, such as a couch co-op game of Overcooked or SuperBomberman.
     
  3. mcooper9

    mcooper9

    Joined:
    Jun 26, 2018
    Posts:
    3
    Thanks for the response, I'll take a look at those games.

    One solution that I've been playing around with was a fog of war that covers the corners of the screen and is shifted up a bit to cover more at the top of the screen vs bottom of the screen but I was wondering if there was another solution so I didn't have to use it.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,947
    You might be able to do something interesting with an oblique camera frustum.

    Google that up but essentially imagine if your "center of sight" forward was NOT the perfect center of the screen.

    https://docs.unity3d.com/Manual/ObliqueFrustum.html

    Perhaps obliquify it towards each player equally?? Might have some other warpy feel to it though...
     
  5. mcooper9

    mcooper9

    Joined:
    Jun 26, 2018
    Posts:
    3
    Thanks for the suggestion Kurt, I think I did play around with that a while ago but was unable to achieve the results I was looking for. I might give it another crack though to see if I missed something.