Can someone help me with calling a method from another Game Object?

I am trying to build an Asteroid game and been following a tutorial. And since I am a complete beginner the following piece of code may have some redundancy however that is there to keep things very simple.

I have an AsteroidSpawner script which is attached to the main Camera. It instantiates an Asteroid and calls the Initialize method of Asteroid script attached to the prefab Asteroid. Following is the code:


void Start ()
        Vector3 location = new Vector3(0, 0, -Camera.main.transform.position.z);
        Instantiate<GameObject>(prefabAsteroid, location, Quaternion.identity);


public void Initialize(int parameter)
    const float MinImpulseForce = 3f;
    const float MaxImpulseForce = 5f;
    float angle = Random.Range(0, 30 * Mathf.Deg2Rad);
    Vector2 direction = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle));
    float magnitude = Random.Range(MinImpulseForce, MaxImpulseForce);
    gameObject.GetComponent<Rigidbody2D>().AddForce(direction * magnitude, ForceMode2D.Impulse);


The above game when played does instantiate an Asteroid game object as per the given location but doesn’t move. However, when the same Initialize code is pasted to the start() method of Asteroid it works just as expected.

I know a possible fix is to copy the code to start() but I am passing a parameter the functionality of which has been avoided here to reduce complexity. Explanation of the above-unexpected output would be highly appreciated instead of alternatives. Thanks!

UPDATE: After messing around a bit I found out that the initialize method is getting called before the start method and maybe that is a possible reason for no forced being added. Can someone suggest a fix to that if this is indeed the case?

Not clear to advise, but would suggest you study: Unity - Manual: Order of execution for event functions to help understand when events are being called