1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. Unity 2017.1 beta is now available for download.
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  8. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice

Shatter Toolkit

Discussion in 'Assets and Asset Store' started by gustavolsson, Jul 8, 2011.

  1. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    328
    I was wondering if there was a way to make a small chunk get chopped out of a mesh. For example when an axe hit a tree how would I take a chunk out where the axe hit and then have the rest of the tree still standing?
     
  2. gustavolsson

    gustavolsson

    Joined:
    Jan 14, 2011
    Posts:
    282
    Not out of the box but it can absolutely be done: Let your tree have a kinematic rigidbody, mesh collider and shatter tool components (with corresponding uv and color mappers). You can use a custom script to call the ShatterTool.Split(planes) method on the ShatterTool component of the tree game object. As parameter, supply 2 planes that that together creates 4 pieces of the tree at the location of the axe hit. Then, define a PostSplit(GameObject[] pieces) function (and check the checkbox on the ShatterTool) in the script that examines which piece is closest to the axe (for example) and makes that rigidbody non-kinematic. You can also add a small force to that piece so that it flies out by itself. This will create 3 kinematic pieces of the tree still standing so it's not optimal, but it works.

    Hope this helps and sorry for the late reply :)
     
  3. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    328
    I have a mesh with 4 materials on it and after I split it I can only use 1 of the materials as it seems to lose some of the data. I'm wondering if there's a way to fix this issue so I can split speed tree game objects.
     
  4. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    328
    I need to preserve the 4 submeshes I think but I'm not really sure.
     
  5. gustavolsson

    gustavolsson

    Joined:
    Jan 14, 2011
    Posts:
    282
    The toolkit only supports one material per game object in its current state. Multiple material splitting is a feature planned for version 2 of the toolkit. Please see the roadmap here: http://gustavolsson.com/roadmap.

    Sorry for the extremely late reply! I've been out travelling throughout the past month and haven't had access to my computer.
     
  6. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    328
    Thanks gustavolsson, is there any timeline on that feature?
     
  7. gustavolsson

    gustavolsson

    Joined:
    Jan 14, 2011
    Posts:
    282
    As soon as I have some free time hopefully. It is currently my last year at university. I should not say any time frame but my goal is to work one day a week on the toolkit(s) this semester. I will let you know here how it goes!
     
  8. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,593
    Looking forward to updates. Shatter has been a nice additional to my platformer prototype.
     
  9. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    328
    Any chance you've added the multiple material splitting feature?
     
  10. gustavolsson

    gustavolsson

    Joined:
    Jan 14, 2011
    Posts:
    282
    Good to hear that you found the toolkit useful! I haven't had the time to work on version 2 during the last semester but now that I'm finishing up school I've started laying the groundwork for the update. I'm still committed to it.

    It's on the list of planned features for version 2 (see http://gustavolsson.com/roadmap). It's not in the current version. Stay tuned :)
     
  11. gustavolsson

    gustavolsson

    Joined:
    Jan 14, 2011
    Posts:
    282
    TwiiK likes this.