title: How to add different gravity on spawning objects?
body: <p>Im working on a project that I want to create a power up effect whenever the button "Q" is pressed, I have the animation working and the character, I also have the spawning objects around my player that I want to spawn (See Figure below)
  <a href="https://i.stack.imgur.com/y2wBF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y2wBF.png" alt="enter image description here"></a>
  My question is how to add different gravity on each rock (spawning object).</p>
  
  <p>Here is the script that I'm currently using.</p>
  
  <pre><code>/* Public Variables Declaration */
  public Transform spawn_LocationForSmall;
  public Transform spawn_LocationForMedium;
  public Transform spawn_LocationForLarge;
  public GameObject smallRock_Prefab;
  public GameObject mediumRock_Prefab;
  public GameObject largeRock_Prefab;
  
  /* Private Variables Declaration */
  private GameObject[] smallRocks_List;
  private float posX, posY, posZ;
  
  private bool smallCount = false;
  private bool mediumCount = false;
  private bool largeCount = false;
  
  private bool small_CheckPos = false;
  private bool medium_CheckPos = false;
  private bool large_CheckPos = false;
  
  
  
  
  void Start() {
  
      //smallRocks_List = GameObject.FindGameObjectsWithTag("smallRock");
  
      Create_Small_Rocks();
  
      Create_Medium_Rocks();
  
      Create_Large_Rocks();
  
  
  }
  
   private void Create_Small_Rocks(){
  
      for(int i=0; i&lt;=20; i++){
  
          small_CheckPos = false;
          posX = this.transform.position.x + Random.Range(-3.0f, 3.0f);
          posY = this.transform.position.y + Random.Range(-3.0f, 3.0f);
          posZ = this.transform.position.z + Random.Range(-3.0f, 3.0f);
  
          if(posX &gt; 3f &amp;&amp; posY &gt; 3f){
  
              small_CheckPos = true;
          }
  
          if (small_CheckPos == true) {
  
              Vector3 newPos = new Vector3(posX, posY, posZ);
  
              GameObject createdObject = GameObject.Instantiate(smallRock_Prefab, 
                  newPos, spawn_LocationForSmall.rotation) as GameObject;
  
              createdObject.transform.parent = spawn_LocationForSmall.transform;
          }
  
      }
      smallCount = true;
  }
   /* the other two functions are similar to this */
  </code></pre>