mgear
December 8, 2010, 12:12pm
1
hi,
Just a test project… : )
FakeSlicer
Slicing a box (but not really)
It works by adjusting box size/vertices and cloning a prefab box as a new slice object
Sliceplane is “fake”, just Y value is used for getting a location
Adjusts rigidbody weights based on object size/density (so each slice has “correct” weight)
Missing: texture adjustment (now it shrinks…)
webplayer:
w/s = move plane up/down
a = slice
mouse = drag objects
*sometimes objects fall through the ground…refresh demo to try again
download:
Package ( script with comments)
447178–15552–$fake_slicer1.unitypackage (666 KB)
Very cool. Thanks for sharing this!
orb
December 8, 2010, 12:45pm
3
Fake? Not sure there are other ways, but no matter how you slice it it’s the end result that matters
Why is it “fake”? It does what it’s supposed to do, and it does it well
Hope you get some time to make it more advanced, though. Something like what Metal Gear Rising are doing:
Keep it up!
Very nice idea,
Try to make the same with cones, this should work ; )
Maybe some will get a cool idea for a slicing game.
One thing i noticed is that the texture gets contrakted.
Can you Change the Tileing of the texure to fix that?
mgear
December 10, 2010, 2:41pm
6
Hi,
Texture can be fixed with uv map atleast…
(planar uvmap code from docs “locked” streching, havent tried others…)
Another simple test scene:
webplayer:
a/d = move cylinder
space = slice
mouse = drag objects
download:
Package ( script with comments)
448895–15647–$fake_slicer2.unitypackage (15.4 KB)
one bug tho… When you cut the cylinder and the cylinder is not under the slicer then it will create a cylinder that has a height of 0
mgear
December 10, 2010, 3:27pm
8
thats the ‘fake slice’ then : )
(min-height checking missing/failed)
My new game ‘Slice the Salomi’ takes place in a butcher shop.
mgear
December 10, 2010, 8:51pm
10
Hi,
Testing different technique
Capsule (but bit too low poly capsulecollider not so good for this…)
‘Infinity plane’ for cutting ( Unity - Scripting API: Plane )
Using “Plane.GetSide” to check which side the vertex is
if above cutplane, move it down with distance from “Plane.GetDistanceToPoint”
Clone the slice from original object
Webplayer:
wasd = move cutting plane
qe = rotate cutting plane (dont rotate it upside down…)
space = slice
mouse = drag objects (try dragging the original object and cut it while hanging in air)
(cannot cut the slices, just the original object, although should be possible to do that, or to cut multiple objects)
Download:
Package ( script with comments)
*edit typo
449114–15657–$fake_slicer3.unitypackage (19.3 KB)
mgear
July 6, 2015, 5:35pm
12
Gaidzin:
What about Skinned Mesh ?
not tested, i guess would need to do this:
http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer.BakeMesh.html
Thank you for answer.
I replaced
mesh = GetComponent(MeshFilter).mesh
on
GetComponent(SkinnedMeshRenderer).BakeMesh(mesh)
Mesh not sliced, but flattened.
screenshots
mgear
July 7, 2015, 1:29am
14
yeah, thats the “fake” part of the slicer it just duplicates the mesh and pushes the “cut” vertices to the cut plane.
Maybe you could improve the effect by placing all cut vertices in the center, so at least they wouldnt stick out…
But there are real mesh slicers in asset store, TurboSlicer and maybe some more,
not sure if theres some free ones…
I’ll try to improve. We will have a free slicer.
1 Like
Any improvement on this topic? I’m really interested on it.
Regards
I have this and the Invector Melee Template, i’m trying to use this to be able to cut enemys apart. so far it works but i can only cut either the mesh or bone, any ideas how I can fix this? Iv’e gotten so close lol
mgear
March 14, 2018, 2:42am
18
no updates to those…
i think asset store had several slicers, for characters also.