Answer the question
In order to leave comments, you need to log in
How to create a prefab and add properties to it?
The bottom line is, I pass data to the script and a prefab with all the data is created from this data.
I do this for example
int ScaleX = 1;
int ScaleY = 1;
int ScaleZ = 1;
GameObject NewPrefab = new GameObject(id);
NewPrefab.AddComponent<Transform>();
NewPrefab.transform.localScale.x = ScaleX;
NewPrefab.transform.localScale.y = ScaleY;
NewPrefab.transform.localScale.z = ScaleZ;
Cannot modify the return value of 'Transform.localScale' because it is not a variable
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question