[SOLVED] List type variable changes type during run time.

I have an object variable whose type is “list of Game Objects”.

I add objects without problems. However if I remove objects until there is only one element the variable type changes to “Game Object” and then all my list logic breaks because the variable is no longer a list (e.g.: I can´t add more Objects to the list)

How can I avoid this?

Show us your script, something is not right, there is no such thing as “changes type” just like that.

Thanks for your reply.

It was just a dumb mistake I was far too tired and sleep to code yesterday. Turn out when I was leaving the list with only one game object I was actually setting it´s value as another variable that was type “game object” and that caused the change.