|
Hello , am having a really wiered problem with assiging names to prefabs am instantiating in the scene , each level I instantiate a number of objects in the scene and I specify a name for each , just using a for loop and adding i to the name of the objects, here is the code: everything is working perfectly except that if I change the variable to_load in the inspector and I play the game , it loads objects an skip somehow a number which causes to have an object without the correct name, but if I reload the level "without any modifications , just click stop then play again" it loads the objects as its suposed to , here are 2 screenshots to explain better: This is First time load: Second time load : I tried many methods ,also to avoide the inspector but with no results , anyone has an Idea what could be causing this problem ? thank you
(comments are locked)
|
|
I'm not particularly sure what you're issue is (never used units before), however i changed some variables around and I believe this works. I basically got rid of your uint and instead declared to_load as an int: Hope that helps! Klep hey , that does not really work for what am trying to do , but yes i fixed it just by assiging the name before instatiating , the problem might be that i come from a flash AS3 programming and it seems that unity has a diffrent way to assign names to the objects .
Mar 07 '12 at 08:16 AM
dohmee44
Haha, glad you got it working in the end! Sorry I couldn't be of more help!
Mar 07 '12 at 08:18 AM
Kleptomaniac
(comments are locked)
|


