I’m new in unity and wasn’t able to figure this out. My question is a bit hard to explain but i’ll do my best.
I’m creating the player information struct to attach it to my prefab of player controller.
I want to instantiate the script, then change it’s variables so I can set them based on the GUI and add them later to my prefab with addComponent.
But unity doesn’t like “new script” I’m not really sure how to do this.
I’ve been wandering around Instantiate() and clone tutorials but I always end up with some error.
public CharacterChart playerChart; // (global)
CharacterChart tempChart; // (local)
tempChart = Instantiate(playerChart) as CharacterChart;
Currently error says the thing(clone) i want to instantiate is null, I suppose this is because I haven’t initialize it.
I’m using c#
thanks
A similar problem: http://answers.unity3d.com/questions/399298/design-patterns-singleton-issue.html
– FL