Greetings,
I am experiencing heavy lagging issue when I am parrenting my instantiated objects, and I do not know why or what I can do too reduce it.
I guess I might need to parrent them in some other way, but after countless of hours trying to figure that out from google I now need all the help I can get.
I need to say though, that I am instantiating alot of objects on very short time, but if I do not parrent the objects, I don’t only lose the lagg but I can instantiate up to probebly 3-4x of the previosly ammount whitout any lagg. So, this obviosly tells me that the lagg is not the ammount of instantiatied objects, but the fact that I am parrenting them!
I even tried to parrent them outside of the for loop, rather after the instantiation was done, but still the lagg is heavy even though I tried to limit the ammount of parrenting each seconds, etc!
It looks to me that parrenting is really taking alot of my computer even though I got a decent one!
GameObject myGAMEOBJECT = Instantiate(myGameObject_LIST[0], new Vector3(myX_CORDS, OnGeneratePerlinNoiseEvent(myX_CORDS, myZ_CORDS), myZ_CORDS), Quaternion.identity) as GameObject;
myGAMEOBJECT.transform.parent = myROOT.transform;
So, that is the code, don’t mind most of it since everything works perfectly as it should do only the lagg ofc!
I really hope someone can help me out whit different method of doing this, since I need those object parrented for the rest of the system to work, since I need each chunk to be in its own object so that I can turn them off individually!
There might be another method for that too, rather then parrenting I mean, but should parrenting be that heavy?
Best Regards,
Winsj