|
Good morning, I am coding a board game in c# and have all of the code I need to handle the touch input of my board game pieces, except that I only seem to have 31 Layers to use, therefore my 31 layermasks to use for my ray tracing. My game uses more than 50 pieces, and I would like them all to be touchable at one point or another.
(comments are locked)
|
|
It isn't possible to use more layers. The layermask is an integer bit mask. Since an integer has 32 bits you have 32 layers. If you had took a look into the documentation you would have found GameObject.layer which allows you to get or set the layer of a GameObject. Also if you read the docs on Physics.Raycast carefully you will notice that there are different versions of this function. Some will return information in the RaycastHit struct you pass by reference. now you should have all you need ;) Thanks for the quick response, Bunny83. I must admit, I could have read the documentation more... but after reading it as much as I have in the past week, I just felt like reaching out to someone that knew what they were doing to see if they had an answer instead. I just started with Unity a few weeks ago, and it's been one heck of a ride so far! I appreciate the links. I will look into that specific documentation now and go from there.
Apr 04 '12 at 07:00 PM
dr3wd
(comments are locked)
|
