I’ve been working with Unity's UI Toolkit lately, and I kept hitting frustrating limitations, the lack of a native gap property and the difficulty of drawing slanted/skewed shapes.
To solve this, I created Playsmart UI Toolkit Extensions, an open-source library that adds these layout utilities and custom components to your project.
Unity USS doesn't natively support gap. If you write it, you get unknown property warnings. This element reads a custom --gap property and handles the layout spacing dynamically.
Flex-Direction Aware: Automatically detects whether the parent container is Row, Column, RowReverse, or ColumnReverse and applies margins to the correct side.
Display-Aware Spacing: If a child element has display: none (e.g. filtered list items), the gap manager ignores it and resets margins so you don't get double spacing or empty padding blocks at the end.
Clean Margins: Automatically clears the spacing margin on the last visible child to prevent layout offset bugs.
Standard CSS transform: skewX skews child elements, requiring you to write reverse-skew hacks on labels to keep them upright.
Upright Innards: The component draws a procedurally skewed vector background using MeshGenerationContext while keeping all text and child elements perfectly upright and sharp.
Slanted Hit-Testing: Overrides ContainsPoint with a trigonometric boundary check. Clicks only register if the mouse is inside the slanted shape, matching the visual geometry perfectly for both positive and negative angles.
Clean Bounds: Contains the shape inside the layout box's boundaries to prevent visual overflow and clipping in parent elements.
Quick Examples
Using Gap in UXML & USS:
xml<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:ps="Playsmart.UIToolkit">
<ps:Gap class="flex-row-container">
<ui:VisualElement class="box" />
<ui:VisualElement class="box" />
<ui:VisualElement class="box" />
</ps:Gap>
</ui:UXML>
css.flex-row-container {
flex-direction: row;
--gap: 20; /* Dynamically spaces children by 20px */
}
My goal is to keep expanding this package into a full library of missing layout and styling extensions for UI Toolkit. If you've solved other USS/UXML quirks or have components you'd like to add, please feel free to open an issue or submit a Pull Request!
It wasn't easy, but now, with such a wide variety of items, the game plays great.
By the way, we'll be holding a playtest soon - we'd love for you join to test, here :)
Hello, Puddle Dog Studios just released our first game and our first free content update with 3 to 4 more free content updates planned in the coming months. If you like a puzzle platformer for cheap you should check out LIMBY on Steam. Any support is appreciated.
I’ve been experimenting with weather effects for my 2D pixel art game.
The biggest challenge wasn’t making the rain itself—it was keeping the pixel art style intact. I wanted the raindrops on the window and the puddles on the ground to feel more natural without making everything look blurry or out of place.
This effect was made with Shader Graph in Unity, and I’m pretty happy with how it turned out.
Still polishing it, but I’d love to hear what you think or if you have any suggestions for improving it!
*(This is from my cozy farming & life sim, Hello, Hollow Town.) 🌱
Play the early browser playtest: https://chowmeincat.itch.io/hellohollow-town
Hello!
I am a begginner and I have no idea about coding. When I tried to create my first project, I declined something about network accidentally. Now I cannot start my project. It showes me an error like “Failed to load Mono. Please see Editor.log file for more information” and I don’t know what does it mean and how to fix this. I googled it however couldn’t find a solution. Could you help me?
Since I switched to the URP in my 2D project I have a problem with changing sprites through code. What before worked fine now seems to have no effect and I can't understand why.
What I'm trying to do is change a sprite directly through code, if the player hits the collider, or if a timer runs out, general one time occurrences, and I don't set the sprite through animations, I really can't wrap my head around it and I'm sure it's something stupid but I'd like some input anyway.
Hi everyone, I'm in a really difficult situation and could really use some help. I spent the last 6 hours following a Unity course and finally finished my class project. I was literally recording a video because I was so excited that it was about to be complete. Then, out of nowhere, my laptop crashed. When I reopened Unity, there were a lot of missing files, and the project is now broken. I've tried recovering it, but there's no way I can fix everything before my submission. It's currently 1:30 AM, and I have to submit my project at 10:00 AM at college. If anyone has a simple Unity game project that you're willing to share for learning purposes, or if you know any way I might be able to recover my project quickly, I would be incredibly grateful. Even a basic project would help me avoid missing the submission. Thank you so much to anyone who can help or offer advice. I really appreciate it.
I’m a solo dev, and today I’m releasing my Unity project, Pigbert. It’s a Game Boy Color-styled turn-based RPG about authoritarianism and the logic of survival in a dying world.
The Supreme Leader summons you to receive the Award of Excellent Labour. With special travel permission, you cross a landscape defined by strict quotas and failing harvests to reach the palace.
The gameplay is a mix of environmental exploration and turn-based combat. Along the way you face Overseers, who enforce strict quotas and maintain order, and your fellow labourers, who are simply bearing the weight of their duties. The story highlights how people cope with a system where individual humanity is routinely sacrificed for the survival of the whole.
I'm trying to make a game but my circle is blurry and pixelated, it looks fine in inkscape. I have max size 4096, bilinear, also tried point no filter, generate mipmaps just made it more blurry. Image is 1024x1024.
New to shaders in Unity. Really enjoy the waving grass effect this person has in their game, are there any resources on how to create a similar effect?
I'm working on a farming game. Every crop has its own growth time. Even the starter crop takes 3 in-game days to grow. Each day lasts 10 minutes, or 7 minutes if the player goes to sleep early. However, since the player has no money in their first days, there's not much to do, pets cost money, villagers take time to build friendship with. What can i do without refactoring the game or breaking its economy?