Search Unity

How to make diamonds fall down?

Discussion in 'Scripting' started by OkeyNik, Sep 19, 2017.

  1. OkeyNik

    OkeyNik

    Joined:
    Mar 14, 2017
    Posts:
    41
    How can i make diamonds fall down? I mean when i dont touch diamons with ball they still fly in the air, but then ball touch them they destroy and this is right. But how can i make them fall down if ball dont touch them?



    Here the code:
    1. void OnTriggerEnter(Collider col){
    2. if (col.gameObject.tag == "Diamond") {
    3. GameObject part = Instantiate (particle, col.gameObject.transform.position,
    4. Quaternion.identity) as GameObject;
     
  2. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    Add a Rigidbody to an object for it to be affected by gravity and other forces.
     
  3. lordconstant

    lordconstant

    Joined:
    Jul 4, 2013
    Posts:
    389