I wrote a script for an evolution simulator i’m making, but when I press play nothing happens. I have the script attached to an empty game object named “Summon”. I am using unity2d
//Easily editable variables and what they do
int mutationFactor; // Amount of randomness concerning the limb mutation
// The actual code
public Texture2D Body0;
public Texture2D Body1;
public Texture2D Body2;
public Texture2D Body3;
// Use this for initialization
void Start () {
MakeCreature(0, 0, true);
}
// Update is called once per frame
void Update () {
}
void MakeCreature(int bodyTypeID = 0, float bodyRot = 0, bool firstGen = false) { // Makes a creature with a specifed body type and randomized limbs
if (firstGen == false) {
}
else {
// Note to self: Make this random
CreateBody(Body0/*Note: Change this*/, new Vector2(1, 1)/* Note to self: Make this random*/, new Vector2(1, 1));
}
}
void CreateBody (Texture2D bodyTexture, Vector2 size, Vector2 Pos) { // Body making function
Sprite.Create(bodyTexture, new Rect(0, 0, 64, 64), new Vector2(0.5f, 0.5f), 40); // This makes the body sprite
// note to self: add rigidbody2d
}
}`