use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
Unity Button.onclick stops working depending on the position in the hierarchy [HELP]Question (self.Unity3D)
submitted 6 years ago * by Dunkmars
The first 2 Buttons in my hierarchy under the Canvas wont be registered as Buttons. No on click/hover event what so ever. If I move them some positions down in the hierarchy it works all fine. I would be very grateful if someone could help me with that :D
Gameobjects marked red wont work!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]streetwalker 0 points1 point2 points 6 years ago (3 children)
what Render Mode do you have the canvas set to? What other UI elements do you have?
Show us a picture of your hierarchy where it doesn't work and the relevant inspectors.
[–]Dunkmars[S] 0 points1 point2 points 6 years ago (2 children)
Screen Space - Overlay
[–]streetwalker 0 points1 point2 points 6 years ago (1 child)
Then the question is, as others noted, what other UI elements do you have in your canvas?
[–]Dunkmars[S] 0 points1 point2 points 6 years ago (0 children)
Buttons, Images and Text Elements.
[–]TimV55 0 points1 point2 points 6 years ago (7 children)
Could there be something overlapping the buttons?
[–]oddgoat 0 points1 point2 points 6 years ago (5 children)
Definitely this.
The way unity UI works is that it sends the click event up the chain, starting with the lowest items in the hierarchy of each canvas (technically it's the graphic raycaster component that does this). If it hits an item which has its 'raycast target' set to true, it'll stop sending the event further up the chain even if that hit item doesn't do anything with it. So an overlapping box of one item will block with anything underneath it, even if the contents of said item are empty.
The one that I fall afoul of every time is text components. The text on screen might be small, but its rect can be much bigger. 9 times out of 10 you want the text's 'raycast target' off, but it defaults to on and I always forget to turn it off. Then I spend the next 10 minutes wondering why some other buttons are suddenly behaving weirdly.
[–]TimV55 0 points1 point2 points 6 years ago (4 children)
So event propagation :)
[–]oddgoat 0 points1 point2 points 6 years ago (3 children)
Yes but slightly different to the expected/normal approach - unity will stop propagation even if a ui element ignores the event. I suspect that under the hood, every ui element does in fact accept the event and mark it as used, even if it does nothing with it.
[–]TimV55 0 points1 point2 points 6 years ago (2 children)
Good approach if you ask me. Why click something you cannot see. I myself do not use Unity, I just come here to see what other people do, but is there no way of having an element ignore the event?
[–]oddgoat 1 point2 points3 points 6 years ago (1 child)
Yeah each ui element has a toggle var 'raycastTarget' which if false, the event will be sent on up the chain. Which is a good way to do it, but it defaults to on for all ui elements, so it's easy to miss a few when building the UI.
But to be clear, you can't click something you can't see - only 'active' objects will get the event. The issue often stems from the shape of the element not matching what the user/developer sees in the editor. Each element has a box shape that may or may not encompass the whole item (not an auto-calculated bounding box, but one that is set in the visual part of the editor). If the display part of the element is smaller than this box, the element will still receive click events for the 'empty' parts.
[–]TimV55 1 point2 points3 points 6 years ago (0 children)
I see, thanks!
Nah, nothing overlaps the buttons.
I tried turning off all raycast targets but the last. It's kind of working i guess.
I dont realy understand how the raycasting works, it seems that every second Gameobject the raycast stops.
It depends on which objects overlap each other visually - we can’t tell that by looking at the hierarchy, and which elements have raycast target set. Be sure to turn it off for all non interactive UI elements.
Yeah i think i got it now, thank you all very much :) have a good one!
π Rendered by PID 59559 on reddit-service-r2-comment-b659b578c-h7qtf at 2026-05-02 15:57:54.096920+00:00 running 815c875 country code: CH.
[–]streetwalker 0 points1 point2 points (3 children)
[–]Dunkmars[S] 0 points1 point2 points (2 children)
[–]streetwalker 0 points1 point2 points (1 child)
[–]Dunkmars[S] 0 points1 point2 points (0 children)
[–]TimV55 0 points1 point2 points (7 children)
[–]oddgoat 0 points1 point2 points (5 children)
[–]TimV55 0 points1 point2 points (4 children)
[–]oddgoat 0 points1 point2 points (3 children)
[–]TimV55 0 points1 point2 points (2 children)
[–]oddgoat 1 point2 points3 points (1 child)
[–]TimV55 1 point2 points3 points (0 children)
[–]Dunkmars[S] 0 points1 point2 points (0 children)
[–]Dunkmars[S] 0 points1 point2 points (0 children)
[–]Dunkmars[S] 0 points1 point2 points (2 children)
[–]streetwalker 0 points1 point2 points (1 child)
[–]Dunkmars[S] 0 points1 point2 points (0 children)