Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cloth collision is not working?
#1
sorry i'm not good to english..

I read this document(http://obi.virtualmethodstudio.com/tutor...thing.html) and try.
Collision worked fine when I moved Unity chan as an animator.

but, If I change the rotation of each joint directly like below, the collision does not seem to work...

```
// Apply the processing below to each joint
Transform t = animator.GetBoneTransform(boneId);
t.localRotation = Quaternion.Slerp(t.localRotation,initialRotations[bone]*modifiedRotation, smoothFactor * Time.deltaTime);
```

Is there a way to enable cloth collision while rotating the relation directly?
Reply
#2
(25-07-2017, 03:41 PM)nomura Wrote: sorry i'm not good to english..

I read this document(http://obi.virtualmethodstudio.com/tutor...thing.html) and try.
Collision worked fine when I moved Unity chan as an animator.

but, If I change the rotation of each joint directly like below, the collision does not seem to work...

```
// Apply the processing below to each joint
Transform t = animator.GetBoneTransform(boneId);
t.localRotation = Quaternion.Slerp(t.localRotation,initialRotations[bone]*modifiedRotation, smoothFactor * Time.deltaTime);
```

Is there a way to enable cloth collision while rotating the relation directly?

It depends on when are you transforming the joints. If you are doing this in Update or LateUpdate, for instance, then you're moving joints each frame after all collisions have happened (by default physics are always updated in FixedUpdate()), thus collisions will be ignored.  

If this is the case, change the solver's simulation order to LateUpdate.

cheers,
Reply