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:
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?