Answer the question
In order to leave comments, you need to log in
Unity The object is in a different layer, but the code says otherwise. How to fix?
There are several objects on the scene, they have 2 types of layers (layer1, layer2), layer1 has the most objects. All these objects are combined into one object ("mainObject"), which has a Default layer.
But in the mainObject.layer code, not the Default layer, but layer1 will be displayed! Why and how to fix it?
(Unity2d)
Answer the question
In order to leave comments, you need to log in
The error itself was due to the fact that unity offsets the layers by 1, and the answer is here:
https://gamedev.stackexchange.com/questions/119667...
The problem is in your code.
Look for your object there and after that - request properties.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question