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
0
Question by DynamicPrgm · Mar 19, 2013 at 04:50 PM · camerarenderingfpsgunspecific

How do I render something specific to a camera?

I am making a multiplayer fps and am currently modeling and animating assets before I begin. I realized that I want to model arms and a gun to be specific to the player controlling it, so I can position them to look good to the camera, and have a model for everyone else to see, and there will be many instances of this. I need the camera of the controller to only render his arm-gun model, and not everyone else's arm-gun model. I don't know if I could use camera layers...

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Loius · Mar 19, 2013 at 04:57 PM

The arms of other players shouldn't even exist on this player's client.

You can only look from one player's point of view at a time, so you only need one 'arms'. You can use camera layers, for sure - in fact, layers also prevent your first-person models from shoving through the wall in front of you.

You can only see arms while in someone's first-person view. So, if you're not in first-person, move the arms out of view, and when you go back in, move them back in view. Or disable/enable them.

Comment
Add comment · Show 2 · 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 DynamicPrgm · Mar 19, 2013 at 06:47 PM 0
Share

Okay. Thanks, but to do this, would I only have a network view attached to the player model and not the gun model? The gun is a child of the camera, which is a child of the first person controller with the model and first person controller collider. I understand this, I just don't know how to implement it.

avatar image DynamicPrgm · Mar 19, 2013 at 06:53 PM 0
Share

The only thing that needs to be sent to the client from all the other clients is the other players' models I realize, so I have a question: If i have a Network View attached to the model of the player with the animations and the collider and all, would Its children also be sent to the clients?

avatar image
1

Answer by hoy_smallfry · Mar 19, 2013 at 05:03 PM

Camera layers are actually exactly what you need to do if its a split screen multi-player. You need to have a layer for the arm-gun model, and one for the full-body model, one for each character. Example:

arm_gun_1, full_body_1, arm_gun_2, full_body_2, ... arm_gun_N, full_body_N

Then, mark each corresponding model with their layer (you probably should have them in separate game objects to do this).

Finally, go to the camera inspector properties. Under "Culling Mask", make Player 1's camera use "Default", "arm_gun_1", "full_body_2", "full_body_3", ... "full_body_N". Then do the same with the other cameras, each one only using their player's "arm_gun_X" layer.

If its a online multiplayer, then there is no need for arm models attached to the other player characters. The only thing that needs to be sent through the network is data regarding the players position, direction, speed, what he's currently doing, etc. The game should then just do whatever it wants to render that information, which in this case means showing only the players set of hands and the other players full bodies.

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 DynamicPrgm · Mar 19, 2013 at 06:49 PM 0
Share

Thanks. I was wondering how I would do this with split screen.

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

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Zooming in with a gun, Halo style. 2 Answers

How to get the camera to hold the gun? 1 Answer

Problem with camera 1 Answer

camera rendering fps 0 Answers

FPS (sometimes) invisible gun?! 2 Answers


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