- Home /
Objects go through InteractiveCloth, why?
I'm simulating a basketball game, and I have the net with the basket, attached and it mostly works ok.
But recently I've had to adjust the distance and the balls are getting through the ring faster than before. And now most of the times the ball just goes through one of the "cracks" inside the net The net is a cilinder, with a shorter end on one side things that I have tried: - increased thickness (cant increase more or the ball won't go through) - increased friction (same thing) - decrease "stretching stiffness" (the whole net stretches to infinity due to gravity
Anyways, I've tried changing all the parameters in the interactive clothing but I can't accomplish the results that I want. If the ball goes slowly enough this doesn't happen though. Basically I'm wondering why this happens, and how to solve it, looking for something other than the settings in the interactive cloth component. Maybe I'm missing something. I will try every suggestion you give me.
TL;DR the ball goes through the net if it's thrown just a bit fast. What could be happening here? is it a bug?
Cloth physics are hards.
$$anonymous$$y suggestion would be to change the ball's rigidbody physics to 'Continuous' ins$$anonymous$$d of 'Discrete'. The hope would be that the ball would then push its way from point to point ins$$anonymous$$d of sorta-teleporting.
Thank you, I had already tried that too. In fact when I went to change it was already in continuous.
I am having a similar problem, regarding a soccer type net. The ball goes through the cloth if it comes at any angle other than straight on. Did you ever get a solution for this?
The best I could do was increase as much as possible the thickness of the net, and the friction and basically all the values that would stop the ball a little bit. Since my net for the basket is a cylinder I can't increase the thickness too much or the ball won't go through. But maybe in your net you can increase thickness further. In the end all I could do to solve it was to move the characters closer to the basket, so the ball doesn't go too fast and it only happens rarely (but it still happens, mostly in the phone version) If the ball comes with enough strength and in certain angles it breaks it.
Here is my game on webplayer: bitly.com/memebasket and for Android: https://play.google.com/store/apps/details?id=com.$$anonymous$$llosoft.memebasket
Co$$anonymous$$g back to this question, after a while, I believe that the reason could be simply the low floating point precision of current smart phones. Since this never happens in the 64 bit windows version. $$anonymous$$aybe it won't happen in the new samsung and iphone hardware.
Answer by Ryuuguu · Apr 03, 2014 at 01:55 PM
Cloths don't have real colliders they force interaction. if you can make a collider on another object follow the cloth.
I do not know if this nonCPU intensive or not but it works. Make a separate game object with a mesh collider as child at (0,0,0) position relative to the cloth. put in in a lyer that does collide with the cloth. This gives a mesh collider that follows the cloth.
put this on the object
public InteractiveCloth cloth;
public Mesh mesh;
void Start () {
mesh = (Mesh)Instantiate(cloth.mesh);
GetComponent<MeshCollider>().sharedMesh = mesh;
}
void Update () {
calcFreqCount = calcFreq;
GetComponent<MeshCollider>().sharedMesh = null;
mesh.vertices = cloth.vertices;
GetComponent<MeshCollider>().sharedMesh = mesh;
}
this will clash with the original cloth mesh and makes the whole cloth jumpy.
Your answer
Follow this Question
Related Questions
InteractiveCloth & ClothRenderer pauseWhenNotVisible issue 0 Answers
Unable to move InteractiveCloth with AddForceAtPosition 0 Answers
Strange problem with cloth 2 Answers
Unity 5.0.x Cloth physics issue. 1 Answer
Get a free moving ball. 1 Answer