# object splitter

**URL:** https://discussions.unity.com/t/object-splitter/414633
**Category:** Community Showcases
**Created:** [May 26, 2010, 8:31pm UTC](https://discussions.unity.com/t/object-splitter/414633 "2010-05-26T20:31:51Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 26, 2010, 8:31pm UTC](https://discussions.unity.com/t/object-splitter/414633/1 "2010-05-26T20:31:51Z")

</div>

demonstration link: [http://dl.dropbox.com/u/7197062/bear-cutting.jpg](http://dl.dropbox.com/u/7197062/bear-cutting.jpg)

---

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 26, 2010, 8:32pm UTC](https://discussions.unity.com/t/object-splitter/414633/2 "2010-05-26T20:32:09Z")

</div>

now I’m writting tree cutting code such as in cryengine.  
will anybody buy this script?

---

<div class="post-metadata">

### Author: ![Eric5h5](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eric5h5/32/44225_2.png) [@Eric5h5](https://discussions.unity.com/u/Eric5h5)
#### Post date: [May 26, 2010, 8:42pm UTC](https://discussions.unity.com/t/object-splitter/414633/3 "2010-05-26T20:42:06Z")

</div>

That’s pretty cool! The sphere slicing seems to get a little messed up, but the other shapes work.

–Eric

![317339--11196--$picture_2_211.jpg](https://europe1.discourse-cdn.com/unity/original/4X/7/d/9/7d95489f75d15c80ecfb74dbd684d8784788cb46.jpeg)

---

<div class="post-metadata">

### Author: ![Slem\_1](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/slem_1/32/393959_2.png) [@Slem\_1](https://discussions.unity.com/u/Slem_1)
#### Post date: [May 26, 2010, 10:06pm UTC](https://discussions.unity.com/t/object-splitter/414633/4 "2010-05-26T22:06:09Z")

</div>

Would this work with any mesh or is it just primitives?

---

<div class="post-metadata">

### Author: ![xandeck](https://avatars.discourse-cdn.com/v4/letter/x/a88e4f/32.png) [@xandeck](https://discussions.unity.com/u/xandeck)
#### Post date: [May 26, 2010, 10:26pm UTC](https://discussions.unity.com/t/object-splitter/414633/5 "2010-05-26T22:26:06Z")

</div>

Looks very interesting, I will follow this 8)

---

<div class="post-metadata">

### Author: ![PolyMad](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/polymad/32/525897_2.png) [@PolyMad](https://discussions.unity.com/u/PolyMad)
#### Post date: [May 26, 2010, 11:55pm UTC](https://discussions.unity.com/t/object-splitter/414633/6 "2010-05-26T23:55:02Z")

</div>

This could be a good feature but you must refine it.  
Not many people will use it for primitives.  
But you could probably sell something for some well done mesh real time splitter.

---

<div class="post-metadata">

### Author: ![KHopcraft](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/khopcraft/32/582170_2.png) [@KHopcraft](https://discussions.unity.com/u/KHopcraft)
#### Post date: [May 27, 2010, 12:18am UTC](https://discussions.unity.com/t/object-splitter/414633/7 "2010-05-27T00:18:21Z")

</div>

Neato.

---

<div class="post-metadata">

### Author: ![anon\_1914106](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@anon\_1914106](https://discussions.unity.com/u/anon_1914106)
#### Post date: [May 27, 2010, 4:32am UTC](https://discussions.unity.com/t/object-splitter/414633/8 "2010-05-27T04:32:30Z")

</div>

nice for cutting enemies with a samurai sword :lol:

---

<div class="post-metadata">

### Author: ![SomebodyZA](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/somebodyza/32/441862_2.png) [@SomebodyZA](https://discussions.unity.com/u/SomebodyZA)
#### Post date: [May 27, 2010, 4:34am UTC](https://discussions.unity.com/t/object-splitter/414633/9 "2010-05-27T04:34:42Z")

</div>

Very nice idea can we have the Code please

---

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 27, 2010, 9:57am UTC](https://discussions.unity.com/t/object-splitter/414633/10 "2010-05-27T09:57:40Z")

</div>

I have updated scene: [http://bestgames.ge/objectsplitter.html](http://bestgames.ge/objectsplitter.html)  
I know there are many problems, but now you can split soldier 😄 :twisted:

---

<div class="post-metadata">

### Author: ![dragonjack](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@dragonjack](https://discussions.unity.com/u/dragonjack)
#### Post date: [May 27, 2010, 11:14am UTC](https://discussions.unity.com/t/object-splitter/414633/11 "2010-05-27T11:14:52Z")

</div>

That’s so amazing

---

<div class="post-metadata">

### Author: ![anon\_1914106](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@anon\_1914106](https://discussions.unity.com/u/anon_1914106)
#### Post date: [May 27, 2010, 1:13pm UTC](https://discussions.unity.com/t/object-splitter/414633/12 "2010-05-27T13:13:43Z")

</div>

would it be too hard to give direction to the cut?

maybe you can record where the raycast 1st hit and where it last hit and get the direction from that?

---

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 27, 2010, 7:33pm UTC](https://discussions.unity.com/t/object-splitter/414633/13 "2010-05-27T19:33:46Z")

</div>

> [@""](#):
>
> would it be too hard to give direction to the cut?
> 
> maybe you can record where the raycast 1st hit and where it last hit and get the direction from that?

now I’m refining code for good splitting. I have that in mind to split mesh with sword depended on sword trajectory.

---

<div class="post-metadata">

### Author: ![lion-gv](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lion-gv/32/420283_2.png) [@lion-gv](https://discussions.unity.com/u/lion-gv)
#### Post date: [May 28, 2010, 6:03am UTC](https://discussions.unity.com/t/object-splitter/414633/14 "2010-05-28T06:03:09Z")

</div>

very cool.

yes, having the option the the cut to be at an angle would be nice so that the top part would slide off the bottom part, instead of just stacking up.

---

<div class="post-metadata">

### Author: ![PolyMad](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/polymad/32/525897_2.png) [@PolyMad](https://discussions.unity.com/u/PolyMad)
#### Post date: [May 28, 2010, 6:30am UTC](https://discussions.unity.com/t/object-splitter/414633/15 "2010-05-28T06:30:39Z")

</div>

> [@""](#):
>
> > [@""](#):
> >
> > would it be too hard to give direction to the cut?
> > 
> > maybe you can record where the raycast 1st hit and where it last hit and get the direction from that?
> 
> now I’m refining code for good splitting. I have that in mind to split mesh with sword depended on sword trajectory.

I think you can start with a random inclination split, where the user can choose a range like -20 to +30 degrees on x and y axis in example.

---

<div class="post-metadata">

### Author: ![scinfu\_1](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@scinfu\_1](https://discussions.unity.com/u/scinfu_1)
#### Post date: [May 28, 2010, 10:03am UTC](https://discussions.unity.com/t/object-splitter/414633/16 "2010-05-28T10:03:10Z")

</div>

Following

---

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 28, 2010, 5:47pm UTC](https://discussions.unity.com/t/object-splitter/414633/17 "2010-05-28T17:47:49Z")

</div>

I have refined code and now the soldiers are splitted very well 😄

www.bestgames.ge/objectsplitter.html

now I’ll begin working on direction splitting

---

<div class="post-metadata">

### Author: ![Peter\_G](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/peter_g/32/381379_2.png) [@Peter\_G](https://discussions.unity.com/u/Peter_G)
#### Post date: [May 28, 2010, 9:12pm UTC](https://discussions.unity.com/t/object-splitter/414633/18 "2010-05-28T21:12:03Z")

</div>

Very cool 😄. This is probably a directional issue, but if you shoot a soldier in the arm, his whole body separates.

---

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 28, 2010, 9:50pm UTC](https://discussions.unity.com/t/object-splitter/414633/19 "2010-05-28T21:50:20Z")

</div>

> [@Peter G](#):
>
> Very cool 😄. This is probably a directional issue, but if you shoot a soldier in the arm, his whole body separates.

yes, the code splits object on Y position, but if the arms will be separate object with changed gizmos, for example may be in 3d max, rotate Y gizmo to be on that direction on which direction you want to cut, now on theese models Y is upward.

---

<div class="post-metadata">

### Author: ![temo\_koki](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/temo_koki/32/504167_2.png) [@temo\_koki](https://discussions.unity.com/u/temo_koki)
#### Post date: [May 28, 2010, 9:57pm UTC](https://discussions.unity.com/t/object-splitter/414633/20 "2010-05-28T21:57:46Z")

</div>

[http://bestgames.ge/objectsplitter.html](http://bestgames.ge/objectsplitter.html)

Updated, splitting with sword 😄

I haven’t wrote direction splitting yet, but it looks fantastic 😄

I changed code to split one object only once but it was boring, now you have sword looks likes electro saw

[Next page](https://discussions.unity.com/t/object-splitter/414633.md?page=2)
