Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lock Softbody Movement & Cut it
#1
I'm making a softbody cutting game. A knife stays above the softbody object (Slime) and can be moved vertically down in a straight motion plane (Y-plane only) by user touch drag to "cut" a piece off the slime. (The knife does not rotate during the motion, only moves up and down). The plane of cutting can be selected by moving the knife above in any horizontal direction. (X-plane only)

I want the spherical slime softbody to appear to be 'frozen' or hovering just above a platform below it (Frozen position and rotation), but STILL be affected by the knife if user touches it (Bend inwards when knife is penetrating the slime). Once the knife penetrates to a deep enough Y-position inside the slime, I use a mesh cutting tool (Ezy Slice) to cut off the mesh at that Y-plane and will instantiate a new softbody (Generating new blueprint and softbody cut piece) which falls off to the platform below.

----

Two questions:

1. How do I lock the position of a softbody upon instantiating it's prefab? What if I want to define my own spawn position and lock the object there? The transform does not seem to be in sync with the object's actual position once it touches anything and slightly moves. (And yes, I have made the 'main' softbody a child of an empty parent object and then tried moving). Currently it seems to move away if the knife touches it from above. 

2. Is the aforementioned kind of mesh cutting possible? The cutting usually works very well with non-softbody regular meshes, but I'm thinking how do I go about cutting off a part of the main softbody considering the original mesh is no longer preserved because of the particle based way Obi softbody works? 

The mesh cutting algorithm is such that at the cutting plane, the original mesh is destroyed and two new meshes are generated preserving their positions with respect to the original object. The cross section of both meshes use the material of original object. 

------

My plan is -

1. When the knife reaches cutting Y-position, Preserve mesh shape of the softbody in it's instantaneous "bent" shape, then pass THAT on to the mesh cutter.

2. Destroy the original softbody, generate two new meshes and their shapes and position being the same as previous state of main softbody, then generate their blueprints and convert them to softbodies, then add gravity to the smaller piece so it falls off to the platform below.

3. The above two steps need to happen at a duration of below 1 second or so. As the mesh cutting works very fast with regular meshes (Any polycount and shape on mobile), the only hindering factor I see here is the time taken to generate blueprint and softbody on runtime.

Will this work?
Reply


Messages In This Thread
Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 06:42 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 09:51 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 10:39 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 10:59 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 27-05-2020, 01:20 PM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 01-06-2020, 10:36 AM
RE: Lock Softbody Movement & Cut it - by arrnav96 - 01-06-2020, 12:24 PM