Decal Collider API
Thanks for stopping by! This page is your developer-friendly guide to driving Decal Collider entirely from code—perfect for spawning bullet holes/footprints at impact points, batching or deferring rebuilds, and collecting analytics in live projects.
What you’ll find here
Core types & namespaces The
DecalColliderclass, its partial API, and related data structures likeRebuildStats.Lifecycle & scheduling Rebuild decals synchronously (
ForceRebuild) or non-blocking via coroutines (AsyncRebuild).Projection & masking controls Set the mask box, direction, size, distance, and alpha threshold directly from scripts.
Mesh & collider generation Tune subdivisions independently, query visual/collider meshes, and bake skinned meshes.
Hit cache & callbacks Read raycast hits, hit materials/transforms, per-layer statistics, and register filtered callbacks.
Analytics & profiling Inspect triangle counts, ray counts, build time, and memory usage from
LastRebuildStats.Geometry helpers Convert world points to decal UV space, project points onto surfaces, draw debug rays.
Snippets & patterns Copy-paste examples for common flows (impact decals, adaptive quality, async progress).
Before you start
Works with Unity 2021.3+ across Built-in, URP, and HDRP.
Designed to mirror editor features at runtime—if you can do it in the Inspector, you can usually script it.
How to use this page
Jump to the method you need in the sidebar, or scan the Quick Recipes section for ready-to-use snippets.
Looking for a gentle overview instead? See Getting Started.
Want the deep dive into every method? Head straight to Full API Details (this link will take you to the method-by-method section).
Happy coding—and have fun stamping perfectly aligned decals wherever your gameplay takes you!
Last updated