Search Unity

How would you hide FPS hands in Unity when in third person?

Discussion in 'General Graphics' started by Lethn, Nov 11, 2016.

  1. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    So some of you may know this, but there
    are a lot of ways to do perspectives in games, I read a very interesting article on Star Citizen on just how much detail they went into when switching between third person and first person cameras in their game and how other developers did cameras and views.

    Does anyone know if there's any documentation or tutorials about this sort of thing? I know about the camera switching, that bit is easy, but what I want to know is how the hell I would keep the FPS hands I want to have in the game hidden if you choose to have a third person view. So when I zoom out my character I don't want to see a second camera there with floating FPS hands and then a whole third person character.

    It would be especially useful knowing how to do this with multiple cameras if I for instance want to use this technique in a multiplayer game. You don't want to see FPS hands floating around and following a bunch of full player models everywhere because that would look really glitchy and ridiculous.

    So as an example, say if I had a character in the FPS view and I was playing that, I could bring up a view of a security camera that can see the third person model, how would I make it so that the security camera can't see the FPS stuff including the UI? That's the kind of thing I'm thinking of.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,336
  3. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    OHHHHH!!!

    Thanks! That's perfect and actually pretty interesting, I was wondering what the point of camera layers was so that explains a lot.
     
  4. daniel_alves_bra

    daniel_alves_bra

    Joined:
    Jun 11, 2017
    Posts:
    4
    how about a multiplayer game when you have other players configurated with the same cullingMask? :)
     
  5. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    The other players shouldn't have floating hands, right?
     
  6. daniel_alves_bra

    daniel_alves_bra

    Joined:
    Jun 11, 2017
    Posts:
    4
    Yep, because actually is a third person game that change to first person when the player aim.
    I don't know if is the best approach but I had to create a different layer for the player and the enemies to use the cullingMask.
     
  7. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    If other players shouldn't have floating hands, why not remove the floating hands GameObject on Start or Awake if the player is not the local player?