https://github.com/williambl/unity-destruction
💥 An open-source script to destroy objects realistically in Unity3D.
https://github.com/williambl/unity-destruction
destruction mit-license physics unity unity3d
Last synced: 5 months ago
JSON representation
💥 An open-source script to destroy objects realistically in Unity3D.
- Host: GitHub
- URL: https://github.com/williambl/unity-destruction
- Owner: williambl
- License: mit
- Created: 2017-12-11T22:00:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-22T21:52:00.000Z (about 7 years ago)
- Last Synced: 2024-11-10T17:46:09.116Z (over 1 year ago)
- Topics: destruction, mit-license, physics, unity, unity3d
- Language: C#
- Homepage:
- Size: 3.17 MB
- Stars: 360
- Watchers: 26
- Forks: 44
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unity-destruction
An open-source script to destroy objects realistically in Unity3D.
[Video](https://gfycat.com/EverlastingSharpBantamrooster)
## Features
- Make stuff break up on impact with other stuff!
- Make stuff break up when there's nothing underneath supporting it!
- Make stuff break up for no reason whatsoever!
- Make stuff explode!
- Make stuff make sounds when it breaks up!
- Make stuff make particles when it breaks up!
- Things can also be configured to only partially break apart, depending on impact velocity.
- Includes an example game where you can throw a ball at a cube. It's funner than it sounds.
## How to use
- Make an unbroken and a broken version of your object. I recommend using Blender's [cell fracture](https://duckduckgo.com/?q=blender+cell+fracture) feature.
- Add 'Destruction/Assets/Scripts/Destruction.cs' to the unbroken version.
- Mess with the settings until you get the desired breaking effect.
- For examples, see 'Destruction/main.unity'.
- Use Destruction.Break() to break things via a script, or Destruction.BreakWithExplosiveForce(float, float) to break things with explosive force via a script.