Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by SamTheT · Apr 12, 2015 at 09:38 PM · camerafpsmodel

Making my player model invisible to my camera

So, in FPS games there is a thing where you can only see your hands, not body, but other players do see your model and animations. Is there a way to do this in Unity?

Thanks for help in advance

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Guppie1337 · Apr 12, 2015 at 10:06 PM 0
Share

Attach a camera to your player object and leave whatever you want in view. Hence the reason for First Person. The other players can see your full game object because their field of view includes everything in front of them, not just their hands.

avatar image SamTheT · Apr 12, 2015 at 11:11 PM 0
Share

okaay, gotcha! gonna try that! thanks!

avatar image $$anonymous$$ · Jan 03, 2016 at 06:22 PM 0
Share

Just create a new camera layer, then unchecked the camera layer you just created in the drop down menu of the render layer menu in Ur main cameras setting. The camera should now not render the playermodel.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Addyarb · Apr 12, 2015 at 11:26 PM

Most of the FPS games you play (Call of Duty, Battlefield, etc.) have arm/hand models that they use specifically for those in first person. The rest of the body doesn't actually exist until you die, at which time a ragdoll gets instantiated at your position. You can find some of these hand models (Handy hands) on the asset store, actually.

If you're trying to make it to where you can zoom in and out and still want the nicely modeled hands effect, you can do one of two things:

  1. Carefully place the camera for FPS view so that you don't get any undesirable clipping/cutting of the mesh with your camera. Then, just press a key to zoom in/out from Third Person to First Person.

  2. Have two models. One, your full character, and two, just the modeled hands. If the camera is close enough to being first person, enable the hands and disable the full character. Likewise, if the camera zooms out, disable the hands and enable the full character.

There's only a few instances of popular games that I can think of where you can zoom in seamlessly, one of them being WoW. They use a transparent material for the intermediate stage between Third Person and First Person View. If the camera is close to the character, they turn your character progressively more transparent using the alpha of the material (as well as all of your armor, weapons, etc.).

A few references you'll want to look at if you're interested in achieving these effects:

Changing transparency of material (use alpha instead of RGB)

http://docs.unity3d.com/ScriptReference/Color.Lerp.html http://docs.unity3d.com/Manual/class-Material.html Detect distance between your camera and gameObject to see when to change to transparent: http://docs.unity3d.com/ScriptReference/Vector3.Distance.html Turn gameObjects off and on: http://docs.unity3d.com/ScriptReference/GameObject.SetActive.html

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SamTheT · Apr 12, 2015 at 11:34 PM 0
Share

but I need it for multiplayer, it would look really weird if only pairs of hands were to run on a map

avatar image Addyarb · Apr 12, 2015 at 11:54 PM 0
Share

Sorry if I didn't explain that very well. Here's the setup.

You (the player with the networkView component that you deter$$anonymous$$e is yours by using networkView.is$$anonymous$$ine) would have just the hands. You could put a script on the root gameObject of the hands that goes something like this..

 if(networkView.is$$anonymous$$ine)
 
 gameObject.SetActive(true)
 
 else
 
 gameObject.SetActive(false);

Now, for everyone else, they would see the full models $$anonymous$$us the hands. So on the root gameObject for your full model, you would attach a script that looks something like this:

 if(networkView.is$$anonymous$$ine == false)
 
 gameObject.SetActive(true);
 
 else
 
 gameObject.SetACtive(false);

This is how almost every modern FPS handles characters' visibility. This almost always gives a better result, because you aren't having to handle trivial animations (ones that you won't see anyway) for your character, and you get better detail and easier field of view control by just having two arms.

avatar image SamTheT · Apr 13, 2015 at 02:12 PM 0
Share

thanks for the help! really appreciate it!

avatar image
0

Answer by Calum1015 · Apr 12, 2015 at 11:44 PM

If you are doing a multiplayer game you pretty much need a full model, just put the camera ahead of the head a bit so your not looking through the head, however position the arms, hands and whatever else to the new position. I don't think you can actually disable parts of a single character model just for your view, not without unnecessary scripts that will slow down the game for no reason other than the game creators convenience.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Addyarb · Apr 12, 2015 at 11:56 PM 0
Share

A simple networkView.is$$anonymous$$ine check on the start function is going to cost almost nothing as far as CPU, but running a mecanim animator component, along with instantiating a significantly higher tri-count model and animating it over the lifetime of the game is going to cost exponentially more.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Walk/run animation moves main camera up and down (first person) 1 Answer

Problem with camera and animations in making a Unity FPS 2 Answers

FPS (sometimes) invisible gun?! 2 Answers

FPS recoil 1 Answer

Should I use dual or single camera for fps game? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges