- Home /
Top child of object in hierarchy is supposed to be underneath cube and is, but is blocking higher layer block's OnMouseDown?
Yes this is a long title and I apologize for the confusion. I am having an issue with layers.
Both of these have the same layer. I have tested to make sure this is actually the issue. I am talking about little fruits I made for my game that spawn under leaves on trees.
All fruits are at 0Z as well as the tree leaves. leaves have a sorting order of 8, and 6 on fruits. I have an empty object holding all "farming" related items. For now this is just the fruits. The one at the top of the children in the "farming" object seems to be the only one blocking leaves. Even though it appears under the leaves, it blocks the mouse click. The farming object is below the cube that is cloned to make trees.
I have no idea what to do, I need help. Thanks in advance :)
EDIT
Here's a picture of my layout:
Also the others work. I tested it by rearranging the hierarchy order :)
The object "Cube (0)" is the cube being cloned. The fruits are cloned as well.
Answer by MrSpoke · Apr 07, 2015 at 12:30 AM
You should probably show an image of the project hierarchy because it is definetely a confusing question. For what I understood, and what I suggest you to try is change the object that is blocking the click to the Ignore Raycast layer.
Hope it helps.
Hi @$$anonymous$$rSpoke.
There is a picture in the edit. I cannot make it ignore raycast because I need this to have a function regarding right click.
Hope you can provide further help.
Your answer
Follow this Question
Related Questions
make 2 cubes stick to each other 0 Answers
Add gameObjects to List as objects are instantiated 2 Answers
Building with cubes in Unity,Building meshes out of cubes 0 Answers
Cube Sorter 0 Answers
3D Cube Face Detection 1 Answer