• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Mahesh4Unity · Feb 07, 2014 at 07:35 AM · clothinteractive cloth

ball is passing through Interactive cloth

Hi, I'm new to unity. I'm trying to create soccer game. I have set up the ball and goal post. For the goal post 'net', i used the interactive cloth. I taken 4 box collider for attachment. when i kick the ball sometime ball is passing through cloth. Also, the ball is also passing through the net if ball hits near the collider while it is good in the middle of net. when i tried to increase the density,ball is just sticking with net.

Cloth property as follow:

bending Stiffness : 1
Stretching stiffness : 0.5
damping : 0
thickness : 1.5
selfCollision unchecked
useGravity checked

Fiction : 0.5
Density : 0.8
Pressure : 0
Collision response : 0.4
Attachment Tear factor : 0.5
Attachment response : 0.2

Pls suggest me what should i change?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image doogli · Mar 21, 2014 at 07:18 PM 0
Share

Hi, I'm having exactly the same problem. Also a soccer net, ball sticks or goes through. I am using two box attachment colliders across the top and bottom of the net. I cannot get any collider on the net to fire any collision events, trigger or otherwise. Have you had any jot with this problem? Density and Collision Response seem to be key in changing the dynamics, but it seems that the physics engine is not being used at all for cloth...

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Ryuuguu · Apr 03, 2014 at 01:57 PM

cloth does not have a collider it has force interation. if you want a collider you can try this.

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;

}

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image flarespeed · May 13, 2014 at 10:23 PM 0
Share

I think it should be FixedUpdate, not Update.

avatar image
0

Answer by flarespeed · Apr 29, 2014 at 12:45 AM

from what i've noticed, interactive cloth's collider is made of cylinders around the mesh. it does not appear to have faces in its collider, meaning the cloth acts sort of like a net. if an object is too small, it will simply pass through this net without touching it. i would suggest increasing the number of verts (lines) in your net model.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 5.0.x Cloth physics issue. 1 Answer

InteractiveCloth & ClothRenderer pauseWhenNotVisible issue 0 Answers

Unable to move InteractiveCloth with AddForceAtPosition 0 Answers

Objects go through InteractiveCloth, why? 1 Answer

Is there a way to set the velocity in a Cloth? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges