Hello everyone (again)
I am building my own gameObjecpool. i found some scripts online , but since i am not an ace programmer, some of them are to complex and some of them don’t do what i want. As a way of teaching myself i decided to try to figure it out.
Anywayz.
I am making lists and dictionairies to store old- object positions/rotation/scale.
then i instantiate an x amount of prefabs.
parent them to the parent of the old-object.
and then place them on the position of the old-objects.
this works so-so.
If i instantiate 10 prefabs, then it works fine for the 10. BUT. when they get deactivated i will reposition them to a new old-object position.
This is where it goes wrong.
The parent is rotating.
I am storing the old-objects localposition/localrotation/localScale. so they should align/orientate correctly to the parent.
but when i reposition a prefab, after the first 10, they start to rotate/mis-orientate to the parent.
For me this doesn’t make any sence, cause since i use localPosition/localrotation/localScale. these values should stay the same even though i rotate the parent.
However it appears that the prefab objects start to rotate and chance position. Does anybody have any idea WHY?
(there is no script in the prefabs that affects their position)
Thanks in advance.
III