mjholtzem / unity-2d-destruction Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi, I have added CircleCollider2D #4 support the script, which I need.
Thank you so much for this open source plugin.
Was hoping to get this working, but the segmentation's seem not to be aligning properly with my sprites. I thought it was an issue with using a spritesheet, but have the same result when generating from an individual sprite.
Fragments Generated in editor:
Not sure what's going on here, or if this is just broken in 2018.1.1f1
I noticed that when an object "explodes," the fragments of the object are stuck together until they collide with another object (such as the ground). How do I get the fragments to break apart while the object is still falling? I have tried modifying some of the Rigidbody2D components in the explodable.cs script, but I can't seem to get this to work.
https://forum.unity.com/threads/free-open-source-unity-2d-destruction.382416/
See Comment #24 and #25
It is basically the same.
Best,
InMeVa
I replaced a bunch of GetComponent calls to cache them, so it does less work during runtime.
Aside from that, I like this PoC, thanks for sharing it.
For those wanting to make use of it during runtime:
-you must remove the line for removing unused assets. Instead, you can call it once every so often rather than once per call. to clean up memory leaks.
-you must object pool the creation of the "pieces" so it doesn't call several new GameObjects() and AddComponents<>() in a single frame.
some flaws I've experienced:
-If a parent object has a different scale than the object holding the graphics it all goes terribly wrong.
-If a parent object is controlling the sprite's flip with a negative scale, it also goes wrong.
I've fixed these issues by using lossyscale in various areas.
The generator seems to assume that the sprites pixels will extend to the extreme edges of the sprite, if a sprite has alpha around the edges it will end up scaling up the sprite
Hi,
I'm using the explode() effect when a flower pot falls to the ground.
The problem is that some new parts penetrate the ground. This doesn't occurs when I use the explodeOnClick() script. Can you explain me why occurs this?
I'm also interested in delete the new gameObjects generated. How can I do this?
Regards.
Hey @mjholtzem,
I saw your fantastic little package and found it pretty cool.
But sadly it doesn't quite work for my project as I am working on a 2.5D game where 2D sprites are present in a 3D world.
So, I thought of using your work as a base to make Unity-2.5D-Destruction: https://github.com/Nesh108/Unity-2.5D-Destruction
Currently, the only problem is that the collider for each fragment doesn't perfectly follow the shape (unlike yours). The mesh collider is putting on a fight, I'll see if I can fix that anytime soon.
Let me know!
Hi , is there is anyway to change the mass of all generating piece ?
as I found , the mass of each piece will be 1 as default , I want to decrease the number to something like 0.01 ?
thanks , I got the idea , I didnt notice that the pieces are under the main object , I thought it will be " real time rendering "
awesome package
close it ❤️
Hi, I've been using your awesome UI-effects in a project, but have been struggling to use them in anything that is softmasked (eg on progress bars within a softmasked scrollrect). There's some documentation on recompiling the shaders to work with it, but haven't had any success so far with enabling the support. Would be awesome to have these effects working within a better mask than what Unity offers.
Any help greatly appreciated!
Hello, I'm having a problem with the asset, all fragments are turning transparent after a short period of time. I don't know what could be possibly wrong, any help would be appreciated. Thanks.
I absolutely love your asset! Great work. However, I'm having one problem. I want the fragments to have their alpha fade out after they've been created. Usually I do this with an animation that brings the Sprite Renderer's color's alpha value down to zero. Unfortunately, Unity 2D Destruction generates pieces with Mesh Filters and Mesh Renderers attached, which means I can't do that method. Any ideas on getting this to work? I'm using the Universal Render Pipeline's Sprite-Lit-Default material. Thanks in advance, your asset is awesome! 😁
(Reposted from Unity Forums here)
Hello,
Is it possible to change the material used for the meshes created by your script?
My games uses lights and diffuse materials for the sprites.
I tried just changing the material (to "Sprites/Diffuse") directly in the code but the meshes are black and do not react to the lights.
I have no idea what's going on, I don't know anything about materials, shaders, meshes...
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.