Coder Social home page Coder Social logo

unity-2d-destruction's Introduction

Unity-2D-Destruction

Unity 2D Destruction is a basic tool for breaking 2D sprites into fragments for awesome destruction effects!!!

See it in action!

[Unity Forum] (http://forum.unity3d.com/threads/free-open-source-unity-2d-destruction.382416/)

[Tutorial Video] (https://youtu.be/pe4_Dimk7v0)

Instructions for Basic Use

  • Import the Unity 2D Destruction package
  • drag a sprite into your scene
  • Add an Explodable component and a PolygonCollider2D or BoxCollider2D
  • Set your parameters and click Generate Fragments (repeat until you are satisfied with your fragments)
  • During gameplay, call explode() on the Explodable component to destroy the original sprite and activate the fragments

Detailed Explanation of Parameters

Allow Runtime Fragmentation: Set this to true to generate your fragments during gameplay instead of in the editor. When you call "explode()" the fragments will be generated and the original destroyed. The fragmentaiton operation isn't the fastest so I don't really recommend this.

Shatter Type: Can set this to generate triangular fragments or more "realistic" voronoi fragments.

Extra Points: Ordinarilly the fragments are generated using the points of the collider. With this parameter you can add any number of random points inside the bounds of the collider. Use this to get more random and interesting pieces.

Subshatter Steps: For each subshatter step, the fragmentation operation will be run on each generated fragment. For example if it's set to 2 your sprite will be fragmented, then each fragment will be fragmented, and then those fragments will be fragmented again. I wouldn't set this above 2 and usually 1 is enough.

Fragment Layer: The layer you wish the fragments to be set to

Sorting Layer: The sorting layer you wish the fragments to be set to

Order In Layer: The order in layer you wish the fragments to be set to

unity-2d-destruction's People

Contributors

mjholtzem avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.