So the manual (http://unity3d.com/support/documentation/Manual/Instantiating%20Prefabs.html) gives me this script:
So I copied it and changed it into this because I did it in C#:
for(int y=0; y<5; y++)
{
for(int x=0; x<5; x++)
{
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.AddComponent(Rigidbody);
cube.transform.position = Vector3(x,y,0);
}
}
And the errors I get are these:
Assets/Scripts/brick_wall.cs(12,51): error CS0119: Expression denotes a type', where a
variable’, value' or
method group’ was expected
Assets/Scripts/brick_wall.cs(12,38): error CS1502: The best overloaded method match for `UnityEngine.GameObject.AddComponent(string)’ has some invalid arguments
Assets/Scripts/brick_wall.cs(12,38): error CS1503: Argument #1' cannot convert
object’ expression to type `string’
Assets/Scripts/brick_wall.cs(13,59): error CS0119: Expression denotes a type', where a
variable’, value' or
method group’ was expected
What’s going on?