I am getting the following warning when trying to instantiate a prefab upon a collision with an object: "Number of parameter does not match expected count." Here is the script: Code (csharp): function OnCollisionEnter (object) { if (object.transform.name == "proj(Clone)") { var contact = object.contacts[0]; var rot = Quaternion.FromToRotation(Vector3.up, contact.normal); var pos = contact.point; Instantiate(prefab1, pos, rot); } } Any ideas what's going wrong?
the OnCollisionEnter function wants to be passed a Collision, not a GameObject. Replace the first two lines with: Code (csharp): function OnCollisionEnter (collision : Collision) { if (collision.collider.gameObject.name == "proj(Clone)") {