I started off following a tutorial from the Tornado Twin’s warm game. I made some changes to it so it would work with a project I’m working on. It seems to work fine, however everytime I shoot I get, laserBeam(Clone), in my hierarchy. Is that ok to have the (Clone) attached to it? Here is my script:
var laserBeamPrefab : Transform;
function Update ()
{
if(Input.GetButtonDown(“Jump”))
var laserBeam = Instantiate(laserBeamPrefab, gameObject.Find(“spawnPoint”).transform.position,Quaternion.identity);
Also, I get the error : NullReferenceException: Object reference not set to an instance of an object
LaserFire.Update () (at Assets/Scripts/LaserFire.js:37)
the (Clone) only shows you, that this gameobject was … well… cloned. this happens when you instantiate something. that is normal and nothing to worry about.
i don’t know what happens in your line 37 but in case it is within the code you posted… usual errors could be that the spawnPoint object is not found or that the prefab does not exist or has a typo in the name. but that is just guessing without knowing the full script.