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 noob22 · Feb 01, 2012 at 04:54 AM · rangelayerlengthmore

Can cutom layers change length?

The layer the game object is in. A layer is in the range [0...31]. We need more.Is it any way?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Bunny83 · Feb 01, 2012 at 05:30 AM

No, because the layers are represented by an integer bit-mask. An integer is made up by 4 bytes a 8 bit == 32 bit. You can't add or remove bits it's more like a hardware (or hardcoded) limit ;)

I can't imagine any usecase where i would need more than 32 (or even 24 since 8 are predefined) layers. Maybe you can describe your problem and we find an alternative.

Comment
Add comment · Show 8 · 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 noob22 · Feb 01, 2012 at 07:26 AM 0
Share

Our game have 6 players.Each of them have 2-6 layers which control their different mesh to receive different light.Another way to say is our artist
need each player's each place(like:head,body,dress,hair and so on)have different lights.How to do it? Thanks for your help!

avatar image noob22 · Feb 02, 2012 at 02:41 AM 0
Share

Or maybe our problem is we need player's light and they only affect their player
.If we need 100 players,we need 100 layer?

avatar image Bunny83 · Feb 02, 2012 at 09:00 PM 1
Share

Why do you want to use different lights on different body psrts? That won't look very realistic in the end and like you already discovered it's a pure mess. Lights are not ment to change the look of an object. Lights actually should be used like real lights. If you want to change the appearance of an object you usually change / modify the material. Such things should be done in shaders.

avatar image Tseng · Aug 30, 2013 at 08:15 PM 1
Share

Then you are using it wrong. Simple as that. Use the documentation and understand the documentation. `Physics.IgnoreCollision`

avatar image Tseng · Aug 31, 2013 at 05:57 AM 1
Share

Your second wrong assumption. When you have n $$anonymous$$ms and m objects, you'd already (hopefully) have a list that manages or keeps references to all of them. Then you'd need to go through them and register it once when the player is instantiated.

Or easier, doing it the other way around: Have an observable list for each $$anonymous$$m and register your objects for this lists and on initialization, player join/leave/$$anonymous$$m change or when their state changes perform your changes.

It's unlikely to happen that your objects will change 20 times per second and iterating or looping through the $$anonymous$$ms which shouldn't have more than a handful of players on a state change isn't really something to worry about.

Having 24 layers is no excuse for not using your brain to solve a problem. Physic layers are for generic uses. Your use case above is pretty special and special problems require a special solution. Simple as that

Show more comments
avatar image
1

Answer by Tseng · Feb 13, 2012 at 01:56 AM

In regards to your comments in Bunny83's post:

You need a custom color shader to make this work, if that's what you're looking for.

With such a shader, you can have a normal diffuse texture + a color mask texture. The color mask texture would have 4 channels (R, G, B and A) for up to 4 different color areas.

Let's say you want the first part of your armor to be color 1, then you'd have to paint all the areas in red (the R channel in RGB). And a second area with blue (B channel) etc.

Then in the inspector you can set up a color and this color will be applied on the marked areas.

There is a tutorial for Strumpy Shader Editor 4.0 on how to make a color shader. http://www.derekmbest.com/shaders.html

It's not very good in terms of performance and it it has some flaws (i.e with the 4th color), but it should be good enough to give you an idea. I've recently made my own shader, took me whole three days to get it done (because I have/had zero experience about shaders), but works flawlessly now

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

Answer by Eric5h5 · Feb 01, 2012 at 05:26 AM

No, it's not possible to have more than 32 layers.

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

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

8 People are following this question.

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

Related Questions

Array out of its own range? 4 Answers

See whether player is in range of light 2 Answers

Does rapid layer changing affect performance? 1 Answer

different reaction to collisions 1 Answer

Sort Multiple Arrays By Their Length 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