Ive been searching for over an hour now guys, and i cant seem to figure out how to simply destroy a rigidbody (the bullet) and replace it with a gameObject (the bullet hole decal). I got this much code done and attached it to my bullet:
var destroyTime = 2.0;
var Decal = Transform;
function Update () {
Destroy(gameObject, destroyTime);
}
function OnCollisionEnter(collision : Collision) {
Destroy(gameObject);
Instantiate (Decal);
}
But it keeps giving me an error on the Instantiate part: Assets/BulletDespawn.js(13,21): BCE0023: No appropriate version of ‘UnityEngine.Object.Instantiate’ for the argument list ‘(System.Type)’ was found.
…Any help would be greatly appreciated!
P.S. this is a repost… but i posted it in the wrong section last time… sorry