Redscript does not have natively support constructors and to set the data of class fields you would have to either set them manually
publicclassCustomClass{//all the variables publiclet myInt: Int32;publiclet myString: String;}
let myCustomClass = new CustomClass();myCustomClass.myInt =1;myCustomClass.myString ="Hello";
or if you want to do it with a single clean line, you can define a static helper method
publicclassCustomClass{//all the variables publiclet myInt: Int32;publiclet myString: String;publicstaticfuncCreate(inputInt: Int32, inputString: String) -> ref<CustomClass>{//you create the new instance of your class here instead of in your code//and set its variableslet self = new CustomClass(); self.myInt = inputInt; self.myString = inputString;return self; }}
and how to use it
let myCustomClass = CustomClass.Create(1,"Hello");