Treasure chest of Unity developer tools. Professional inspector tooling, high-performance utilities, spatial queries, and 20+ editor tools.
Welcome! You’re about to save yourself weeks of repetitive work.
Unity Helpers is a battle-tested toolkit that eliminates the boring, repetitive code you’re tired of writing. This guide gets you productive in 5 minutes, whether you’re a beginner or a senior engineer.
Three core principles that save you actual hours:
APIs that handle the tedious stuff:
random.NextWeightedIndex(weights)[SiblingComponent] private Animator animator;Self-documenting code:
[SiblingComponent] private Animator animator; // Clear intent
[ParentComponent(OnlyAncestors = true)] private Rigidbody2D rb; // Explicit search
[ChildComponent(MaxDepth = 1)] private Collider2D[] colliders; // Limited scope
Helpful errors that save debugging time:
Measurable speed improvements:
Real-world impact:
Quality you can trust:
What this means for you:
Jump directly to the solution you need:
Performance Issues?
Workflow Issues?
Architecture Issues?
Comprehensive deep-dive (best for team leads and senior developers):
See it working first, understand the theory later:
See the Installation section in the main README for detailed installation instructions using:
.unitypackage from releases, or clone the repositoryAfter installation, verify the package appears in Window → Package Manager under “My Registries” or “In Project”.
Problem: Unity’s UnityEngine.Random is slow and not seedable.
Solution:
using WallstopStudios.UnityHelpers.Core.Random;
using WallstopStudios.UnityHelpers.Core.Extension;
public class LootDrop : MonoBehaviour
{
void Start()
{
// 10-15x faster than UnityEngine.Random
IRandom rng = PRNG.Instance;
// Basic usage
int damage = rng.Next(10, 20);
float chance = rng.NextFloat();
// Advanced: weighted random selection
string[] loot = { "Common", "Rare", "Epic", "Legendary" };
float[] weights = { 0.6f, 0.25f, 0.10f, 0.05f };
int index = rng.NextWeightedIndex(weights);
Debug.Log($"Dropped: {loot[index]}");
}
}
⚠️ Common Mistake: Don’t use
UnityEngine.RandomandPRNG.Instancetogether in the same class - pick one and stick with it for consistent results.
Learn More: Random Performance
Problem: Writing GetComponent calls everywhere is tedious and error-prone.
Solution:
using UnityEngine;
using WallstopStudios.UnityHelpers.Core.Attributes;
public class Player : MonoBehaviour
{
// Auto-finds SpriteRenderer on same GameObject
[SiblingComponent]
private SpriteRenderer spriteRenderer;
// Auto-finds Rigidbody2D in parent hierarchy
[ParentComponent]
private Rigidbody2D rigidbody;
// Auto-finds all Collider2D in immediate children only
[ChildComponent(OnlyDescendants = true, MaxDepth = 1)]
private Collider2D[] childColliders;
void Awake()
{
// One call wires everything!
this.AssignRelationalComponents();
// Now use them
spriteRenderer.color = Color.red;
rigidbody.velocity = Vector2.up * 5f;
Debug.Log($"Found {childColliders.Length} child colliders");
}
}
⚠️ Common Mistake: Don’t call
AssignRelationalComponents()inUpdate()- it should only run once during initialization (Awake/Start).
Learn More: Relational Components
LifetimeScope.Configure, call builder.RegisterRelationalComponents().RelationalComponentsInstaller to your SceneContext and (optionally) enable the scene scan on initialize.RelationalComponentsInstaller alongside your SceneScope. The installer binds the assigner, hydrates the active scene, and can listen for additive scenes. Use ContainerRelationalExtensions helpers (InjectWithRelations, InstantiateGameObjectWithRelations, etc.) when spawning objects through the container.Problem: Finding nearby objects with FindObjectsOfType and distance checks is O(n) and slow.
Solution:
using WallstopStudios.UnityHelpers.Core.DataStructure;
using UnityEngine;
using System.Collections.Generic;
public class EnemyManager : MonoBehaviour
{
private QuadTree2D<Enemy> enemyTree;
private List<Enemy> nearbyBuffer = new(64); // Reusable buffer
void Start()
{
// Build tree once (O(n log n))
Enemy[] enemies = FindObjectsOfType<Enemy>();
enemyTree = new QuadTree2D<Enemy>(enemies, e => e.transform.position);
}
public List<Enemy> GetEnemiesNearPlayer(Vector2 playerPos, float radius)
{
nearbyBuffer.Clear();
// Fast query: O(log n) instead of O(n)
enemyTree.GetElementsInRange(playerPos, radius, nearbyBuffer);
return nearbyBuffer;
}
}
⚠️ Common Mistake: Spatial trees are immutable - you must rebuild the tree when enemy positions change. For frequently moving objects, use
SpatialHash2Dinstead.
Learn More:
Based on your needs:
Yes! Unity Helpers is:
No! Unity Helpers:
WallstopStudios.UnityHelpers.*)Yes! Unity Helpers is released under the MIT License - use it freely in commercial projects.
Pick one feature that solves your immediate problem:
| Your Need | Start Here | Time to Learn |
|---|---|---|
| Faster random numbers | Random Performance | 5 min |
| Auto-wire components | Relational Components | 10 min |
| Spatial queries | 2D Spatial Trees | 15 min |
| Buff/debuff system | Effects System | 20 min |
| Save/load data | Serialization | 20 min |
| Editor automation | Editor Tools | 30 min |
| Global settings | Singletons | 10 min |
Ready to dive deeper? Return to the main README for the complete feature list.
Building something cool? We’d love to hear about it! Share your experience by opening an issue.
Core Guides:
Deep Dives:
DI Integration:
Need help? Open an issue or check Troubleshooting