class Dot : MonoBehaviour
{
public int size= 100;
//...
}
class GameManager :MonoBehaviour
{
GameObject DotPrefab; //in the prefab there is the Dot.cs code as a component
GameObject DotInstance = Instanciate(DotPrefab);
Dot x=DotInstance.GetComponent<Dot>();
//now x.size=0
//...
}
I want the x.size to be 100 without having to type it down everytime I create another Dot instance.
how does that happen and how to fix it?
Yes, I just found it out… I literally spend 2h to find the bug…
By the way, thank you so much for answering all the questions I put today! It really helps A LOT.