Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Cloth to simulate slime
#5
(10-09-2018, 11:41 AM)josemendez Wrote: For the sphere to react to slime, you'd need to apply physics to the sphere too (add a rigidbody component, so that it can be "pushed" by the cloth), then control it using forces instead of setting its position directly. A collider alone won't do, as it doesn't give the sphere any physical properties (mass, velocity, torque, etc). Depending on how you've implemented input, controlling the sphere via forces can be a bit awkward. You could also attach the sphere to the users' "finger" using a spring or a similar physics constraint.

Now, assuming your slime is a simple rectangular plane, an alternative would be to "clamp" how deep the sphere can be in relation to the slime plane. For instance, if your slime plane is at Z = 0 and its normal points to -Z, then clamp the sphere position so that it cannot move towards positive Z (pass trough the slime). No need to add a rigidbody or use forces, so this is probably the easiest way if my assumptions about your project are correct.
Thanks for the detailed response. As mentioned earlier, I could achieve the "deformation" of the cloth using the sphere using the same technique you mentioned. For now during testing, I'm just manually moving the sphere towards the cloth using gizmos in play mode. 

The cloth does react and get pressed. The issue is, after a certain point of the sphere pressing, the cloth simply lets the sphere pass through it and starts regaining it's shape. It's as if the sphere get's "swallowed" into the cloth. How do I avoid this behavior?

How do I set up the cloth such that it does not let any object pass through it now matter how deep an object is pressed into it? I have both rigidbody and collider components on the sphere as well as cloth.

After further testing, I've been dropping the sphere onto the cloth from a height. My observations are -

1. If sphere rigidbody mass is heavy (1 or 10), on dropping, it bends the cloth momentarily then just passes through and keeps falling into space.

2. If sphere mass is very light (0.01), on dropping, it bends cloth and cloth stops it from passing through. Sphere stays on top of cloth.

3. If sphere with light mass stays on cloth, then if I try moving the sphere with gizmos in scene view, it passes through cloth again and falls.

Why is the cloth not able to stop heavy weight or sudden movement objects?

Also, all particles on all four edges of the cloth plane are fixed.
Reply


Messages In This Thread
Cloth to simulate slime - by arrnav96 - 09-09-2018, 06:06 AM
RE: Cloth to simulate slime - by josemendez - 09-09-2018, 11:32 AM
RE: Cloth to simulate slime - by arrnav96 - 10-09-2018, 11:17 AM
RE: Cloth to simulate slime - by josemendez - 10-09-2018, 11:41 AM
RE: Cloth to simulate slime - by arrnav96 - 10-09-2018, 11:55 AM
RE: Cloth to simulate slime - by josemendez - 10-09-2018, 01:45 PM
RE: Cloth to simulate slime - by arrnav96 - 10-09-2018, 03:47 PM
RE: Cloth to simulate slime - by josemendez - 10-09-2018, 03:56 PM
RE: Cloth to simulate slime - by arrnav96 - 10-09-2018, 04:03 PM
RE: Cloth to simulate slime - by josemendez - 10-09-2018, 04:05 PM
RE: Cloth to simulate slime - by josemendez - 10-09-2018, 04:27 PM
RE: Cloth to simulate slime - by arrnav96 - 11-09-2018, 09:25 AM
RE: Cloth to simulate slime - by josemendez - 11-09-2018, 10:32 AM
RE: Cloth to simulate slime - by arrnav96 - 11-09-2018, 10:25 PM
RE: Cloth to simulate slime - by josemendez - 12-09-2018, 08:09 AM
RE: Cloth to simulate slime - by arrnav96 - 12-09-2018, 01:01 PM
RE: Cloth to simulate slime - by josemendez - 12-09-2018, 02:26 PM
RE: Cloth to simulate slime - by arrnav96 - 12-09-2018, 03:44 PM
RE: Cloth to simulate slime - by josemendez - 12-09-2018, 04:45 PM
RE: Cloth to simulate slime - by arrnav96 - 19-09-2018, 10:29 PM
RE: Cloth to simulate slime - by josemendez - 22-09-2018, 02:17 PM
RE: Cloth to simulate slime - by arrnav96 - 30-09-2018, 03:35 PM
RE: Cloth to simulate slime - by arrnav96 - 06-10-2018, 03:47 AM
RE: Cloth to simulate slime - by akayashi1212 - 26-03-2021, 10:00 AM
RE: Cloth to simulate slime - by josemendez - 26-03-2021, 11:03 AM
RE: Cloth to simulate slime - by akayashi1212 - 27-03-2021, 04:24 AM
RE: Cloth to simulate slime - by josemendez - 29-03-2021, 09:59 AM
RE: Cloth to simulate slime - by akayashi1212 - 29-03-2021, 11:35 AM
RE: Cloth to simulate slime - by josemendez - 31-03-2021, 10:09 AM
RE: Cloth to simulate slime - by akayashi1212 - 31-03-2021, 02:47 PM
RE: Cloth to simulate slime - by josemendez - 31-03-2021, 06:21 PM
RE: Cloth to simulate slime - by akayashi1212 - 01-04-2021, 03:27 AM
RE: Cloth to simulate slime - by josemendez - 01-04-2021, 08:40 AM
RE: Cloth to simulate slime - by akayashi1212 - 01-04-2021, 09:57 AM
RE: Cloth to simulate slime - by josemendez - 05-04-2021, 12:06 PM
RE: Cloth to simulate slime - by akayashi1212 - 07-04-2021, 03:35 AM