Weird problem with moving an InteractiveCloth

I need a cloth to move position, such as a cape following the character for a simple example (although in my case it is different). What I did is attach a collider to it and move the collider’s transform. The problem is that the cloth does not always follow and this is weird. I have noticed that when the cloth is physically moving (due to hanging movements example) it does get dragged, but if I try to move the cloth after it comes to rest (not moving), the collider moves on it’s own without dragging the cloth with it.

The code to move the collider:

function FixedUpdate () {
	
	transform.Translate(Vector3.up * Input.GetAxis("Vertical") * Time.deltaTime * 100);
	transform.Translate(Vector3.right * Input.GetAxis("Horizontal") * Time.deltaTime * 100);
}

Can someone provide me with an example or suggestions?

1 Answer

1

Finally solved. Add a rigidbody to attached collider.

THANK YOU! it was driving me mad! By the way, you can attach a rigidbody component to the parent of the collider's object too.

–

welcome. I would appreciate a thumb up :)

–

I have tried but it says: "You don't have permission to do this action. Please Login as another user" O_O

–

That is because you need 15 karma points to be allowed to vote up. More info [here][1]. Your thought is still appreciated :) [1]: http://answers.unity3d.com/page/faq.html

–