|
This is related to my previous question which I solved another way, but now I started on a new script and trying out a suggestion in my previous question, so now I'm stuck again... my error 'NullReferenceException: Object reference not set to an instance of an object spawnPickup+SpawnAnother$1+$.MoveNext () (at Assets\scripts\spawnPickup.js:13)' PickUpManager - empty game object spawnPickup.js
pickup > cube pickup is an empty game object with a rotate JS on it, and cube is the child, which has a collider , is trigger set
So basically I'm trying to store off the original location of the pickup. When it's destroyed I want to instantiate another one at it's orginal location. I can then go into the level and drop these all over the place.
(comments are locked)
|
|
Looks like the problem is that your 'originTransform' variable is storing a reference rather than a copy of the object's transform. Try creating a copy of the original transform, I don't do javascript but I looked online and I think it should be something like: Hey thanks. I couldn't find anything on clone. Isn't clone just instantiating? I think you gave me an idea though. I never knew about the reference thing. I think to keep it simple I will simply assign the position xyz values into ints and pass those to the spawner. I will look into arrays as well. thanks
Sep 18 '10 at 04:22 PM
EndBoss
(comments are locked)
|
