Trying to understand the tutorials

In the car race on the island tut they have this text as part of the “Car” script.

var frontWheels : Transform[ ];
var rearWheels : Transform[ ];

private var wheels : Wheel[ ];
wheels = new Wheel[frontWheels.Length + rearWheels.Length];

private var wfc : WheelFrictionCurve;

What I don’t understand is this, “[ ]” at the end of Transform and Wheel. What do the brackets do?

I’m not sure what’s going on w/ the wheels designation. They’re obviously passing a value from frontWheels and rearWheels but why the use of “new” and .length I don’t know.

wfc variable??? is WheelFrictionCurve an official variable type? If it’s a variable type defined w/in the script I don’t see where.

Any help in this would be greatly appreciated.

Nevermind on the WheelFrictionCurve. It is a class.

Looks confusing to me as well hmm. The [ ] seem to the same as () in CSharp…actually yeah I look at it now and I have no clue, sorry for not being of any help.

Im guessing its something like in CSharp

Transform frontWheels = new Transform();

…sorry I have no clue.

They indicate that the variables are going to be arrays of the type immediately preceding the bracket. This is true for both C# and Javascript, by the way.

Thanks. I was able to figure out the rest of what’s going on once I learned it was an array.