Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two Quick Beginner Questions
#2
(05-08-2019, 01:53 PM)HenryChinaski Wrote: Hi,

two quick questions:

1. How do you manage that your softbodies collide with each other?
I saw that you can click on Edit Particles, then select "Phase", type in a unique number and click on the "Fill all" icon.
But my objects still don't collide. Also, I think this procedure is a bit tedious. I suppose the workflow is to do it by code?

2. I have a trash bag that was turned into a softbody. When my player collides with the softbody he just walks over it (looks awesome though).
I want the player to kick the trashbag in his walking direction when colliding with it. I thought that the script at the end of this site would be perfect for that:
http://obi.virtualmethodstudio.com/tutor...sions.html

My problem is that I dont find a reference to anything I could use force on, when I reach the point:

Code:
           // this one is an actual collision:
           if (contact.distance < 0.01)
           {
               Component collider;
               if (ObiCollider.idToCollider.TryGetValue(contact.other, out collider))
               {
                   // do something with the collider.
                   //contact.
               }
           }

I know that I can compute all the needed values by checking the collider rigidbody and transform, but what I am looking for is something like:
contact.softbody.addForce();

I hope you understand my issue.

Best regards, and thanks again for the awesome support.

Hi,

1.- Make sure the solver has Particle Collisions enabled, then set your softbody particle phases to a different value using the particle editor: click on "select all", then set the phase value you want.

Also, make sure your particle sampling density is high enough so that there are no huge holes in the softbody representation. You can increase the particle overlap setting when initializing the softbody, so that particles can overlap a bit, closing any gaps. See:
http://obi.virtualmethodstudio.com/tutor...setup.html


2.- Use solver.externalForces[contact.particle] = <your force here>.

kind regards,
Reply


Messages In This Thread
Two Quick Beginner Questions - by HenryChinaski - 05-08-2019, 01:53 PM
RE: Two Quick Beginner Questions - by josemendez - 07-08-2019, 01:41 PM
RE: Two Quick Beginner Questions - by josemendez - 20-08-2019, 10:04 AM
RE: Two Quick Beginner Questions - by josemendez - 20-08-2019, 05:22 PM