I would like to create a decomposable logo in Unity.
By “decomposable logo”, I mean a picture made of many little squares (like pixels) that I could dynamically destroy with any kind of colliders.
To illustrate what I’m asking, I made this pro quality drawing :
So if I have a shape made of those tiny little square and if a collider collide with the shape, I would like the little squares to get away from their initial position.
Create a logo from lots of little squares in Unity or 3d modelling package
Attach BoxCollider (or BoxCollider2D) to all of them. If you want physics, then attach Rigidbody too.
Probably turn off gravity
Probably make them to not collide with each other using collision matrix
Tag them (i.e. “LogoPixel”)
Then it depends on if you want to squares react to any colliders or if you want very special collider which affects any rigidbody or just any pixel from the logo
Create either LogoPixel component (and attach it to every pixel) or LogoEffector component (and attach it to any collider you want to use as effector).
You should detect a collision (by implementing callback in component), understand if you collide with right object (check its tag for example) and implement animation logic by using methods defined in RigidBody (like Unity - Scripting API: Rigidbody.AddForce)
Feel free to ask additional questions at any moment.
Thanks for the answers !
Yesterday, I tried the Atomizer mgear just mentioned and it works great, I now have some pretty cool effects with what I wanted to do.
I’ll probably try mholub solution as well, but I don’t know how I could create my logo with a lot of little squares, since placing them one by one with Unity sounds really tedious.