(17-05-2018, 08:54 AM)josemendez Wrote: Hi there,
You can simply raycast against the rope mesh, why wouldn't that work?. You can get a reference to it from its MeshFilter component.
Hi josemendez, thanks for you reply, I'm new in Unity. My problem is how to add a suitable collider to the rope mesh? Physcis.Raycast needs a collider. I added a mesh collider to the Rope Mesh, but the collider is fixed when the rope is animating. My solution so far is updating the mesh collider in Update() function. Like this:
Code:
void Update () {
GetComponent<MeshCollider>().sharedMesh = null;
GetComponent<MeshCollider> ().sharedMesh = GetComponent<MeshFilter> ().sharedMesh;
}