Search Unity

object splitter

Discussion in 'Made With Unity' started by temo_koki, May 26, 2010.

  1. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    Last edited: Feb 3, 2011
  2. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    now I'm writting tree cutting code such as in cryengine.
    will anybody buy this script?
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's pretty cool! The sphere slicing seems to get a little messed up, but the other shapes work.

    --Eric
     

    Attached Files:

  4. Slem

    Slem

    Joined:
    Jan 28, 2009
    Posts:
    191
    Would this work with any mesh or is it just primitives?
     
  5. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    Looks very interesting, I will follow this 8)
     
  6. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    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.
     
  7. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
  8. LoneWolfGabo

    LoneWolfGabo

    Joined:
    May 6, 2010
    Posts:
    172
    nice for cutting enemies with a samurai sword :D
     
  9. SomebodyZA

    SomebodyZA

    Joined:
    May 8, 2010
    Posts:
    168
    Very nice idea can we have the Code please
     
  10. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  11. dragonjack

    dragonjack

    Joined:
    Jun 15, 2009
    Posts:
    48
    That's so amazing
     
  12. LoneWolfGabo

    LoneWolfGabo

    Joined:
    May 6, 2010
    Posts:
    172
    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?
     
  13. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    now I'm refining code for good splitting. I have that in mind to split mesh with sword depended on sword trajectory.
     
  14. lion-gv

    lion-gv

    Joined:
    Nov 12, 2007
    Posts:
    118
    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.
     
  15. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    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.
     
  16. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    Following
     
  17. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  18. Peter G

    Peter G

    Joined:
    Nov 21, 2009
    Posts:
    610
    Very cool :D. This is probably a directional issue, but if you shoot a soldier in the arm, his whole body separates.
     
  19. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    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.
     
  20. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    http://bestgames.ge/objectsplitter.html

    Updated, splitting with sword :D

    I haven't wrote direction splitting yet, but it looks fantastic :D

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

    lion-gv

    Joined:
    Nov 12, 2007
    Posts:
    118
    It would be neat if you removed mouse look, put rotation on left and right, I think this was the old doom controls, not very popular these days. Doing this would allow you to bind sword tip position to cursor, which would allow you to "draw" the slash of the sword.
     
  22. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308

    If I remove mouse look the sword doesn't go up and down, sword atached on camera
     
  23. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I'm wondering will anybody buy this code? if yes, how many do you pay?
    I don't want to lost my time and I want to know work on this or not.
     
  24. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Cool stuff so far. :)

    I'd suggest adding a couple of features. Check out http://www.tinyandbig.com/ for some ideas. That game allows arbitrary slice planes, has slightly less jittery object separation, and makes slicing a discrete action.
     
  25. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    yes, that is cool and now I'm workin on such effect. If nobody buy such stuff, I'll work on other project because I asked if anyone needs this
     
  26. Danim3D

    Danim3D

    Joined:
    Sep 7, 2009
    Posts:
    18
    I am interested in the sword script when you will succeed to do the cut in relation to the sword direction. Also it would be better to be able to add a delay between each sword cut. Maybe also a small delay before the mesh division.

    An other idea would be to do a shatter effect script for a random mesh explosion of 'x' number of pieces.
     
  27. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    I guess YOU have to put a delay between sword hits in your character code... he only gives you the code to splice the object.
     
  28. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Slap CHOP!

    Nice work :)
     
  29. lion-gv

    lion-gv

    Joined:
    Nov 12, 2007
    Posts:
    118
    I'd be interested in paying to see this project further developed. What types of licensing do you have in mind? similar to what's going on with unityprefabs.com where each person pays $X to buy/use it, or some larger amount and then you'd make it available to all Unity users?
     
  30. NoMaD

    NoMaD

    Joined:
    Feb 1, 2010
    Posts:
    41
    Yeah I think I could spend some money on that too if it was nicer ( Different angle cuts and stuff ) This is a pretty interesting topic - people like to cut stuff to pieces :D
     
  31. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    yes, similar to unityprefabs
     
  32. Asse83

    Asse83

    Joined:
    Aug 1, 2009
    Posts:
    169
  33. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I had seen this, yes it is amazing
     
  34. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282
    Really great work. But even if no one buys it and u never release the code your not wasting your time as u can always use it at your own games :>

    Great work, realistic feeling wish i had it.


    Hugs
     
  35. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    have there been any developments on this great script?
    If needed, there is the unity asset store now(hint hint)
     
  36. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    It wasn't real cutting, now I started writing real cutting script from null and the test scene will be available soon
     
  37. mikesgames

    mikesgames

    Joined:
    Apr 16, 2010
    Posts:
    1,071
    this is awesome!

    I see a fruit ninja clone coming up!

    -Mike
     
  38. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    Here is little demonstration, I'll do more fine quality in next time :).
    I have i3 processor and I had 1300 fps, on cutting process it was 1230 for half second.
     
  39. KillerSneak

    KillerSneak

    Joined:
    Jan 9, 2011
    Posts:
    38
    That looks really nice and clean. Would it be possible to add your script to bullets(rigidbody) and make the bullets collide and take off smale chunks? This would make for an fully destructible and dynamic environment. (maybe you can try it and show a movie of it). Keep up the great work.
     
  40. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I'll think about it, but now I want to finish this script and if I'll be so good, I want to do splitting on skinned meshes too :)
     
  41. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    Fully destructible and dynamic environment will be hard to do, now I can create holes in object(delete triangles),but it must have many triangles to be like hole and it must have mesh collider.
     
  42. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  43. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Hey, cool!
    Can we set the inner texture? Like when you split a watermelon for example, do we get to set the insider texture?

    Does it work on iOS devices? Is it fast enough?

    Keep us updated,
     
  44. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  45. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  46. starpaq

    starpaq

    Joined:
    Jan 17, 2011
    Posts:
    118
    Wow this is even more amazing than i thought. Geez i think i spent a few minutes cutting bears for no particular reason. I hope you know that you are my hero :) I have loss 15 pounds of stress thanks to you, killing teddy bears. I also noticed that the object can be cut not just once but twice. Very good.
     
  47. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    :) thanks for kind words.
    yes, I have turned multiple cutting checkbox in this webplayer, you can cut anytime when this cube enters and exits from bear, but it has more glitches then once cutting.
    This script also has option to choose collider type after cutting(box or mesh), it doesn't has matter what type of collider it have until cutting.
     
  48. sunset

    sunset

    Joined:
    Nov 7, 2010
    Posts:
    61
    Hey nice work.
    Cutting things is great ^^

    I have a wish for the demo.
    Could you put the pedobear in your demo? :D
     
  49. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    :D yes, of course :D
    do you have such model? :)
     
  50. KITT

    KITT

    Joined:
    Jul 17, 2009
    Posts:
    221
    Yes I would purchase this from asset store or other. Keep up the great work!