I am writing the bodyType of the assetsToSave gameObjects into the txt file which works perfectly
assetBodyType[j] = assetsToSave[j].GetComponent<Rigidbody2D>
().bodyType.ToString();
In my txt file there then is the string called "Kinematic" which i am parsing to
assetBodyType[i] = data[0];
I dont need help on saving or loading because this works already. My only problem is how i would assign the string "Kinematic" to the gameObject since it is a string ?
So my only problem is that i cant call the usual function like this
RigidbodyType2D.Kinematic
since i want to replace Kinematic with
assetBodyType[j]
to have the actual bodyType and not everything to kinematic how do i put this string into the function of Rigidbody2D.?? How else could i assign it ?
possibleObjecs[j].GetComponent<Rigidbody2D>().bodyType =
RigidbodyType2D.Kinematic;
I tried searching other methods but couldnt find anything