Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

picking up objects

Discussion in 'Scripting' started by EVenus1, Apr 11, 2015.

  1. EVenus1

    EVenus1

    Joined:
    Mar 31, 2015
    Posts:
    16
    hi every one
    i am trying to make a sphere collect a cube. i am following the roll-ball tutorial, however this is not correct for unity 5. hence my need for help as i have little experience in c~ over than that i have needed to do in this tutorial. i would greatly appreciate any help
    many thanks
    Evenus1
     
  2. Xavior87

    Xavior87

    Joined:
    Feb 22, 2015
    Posts:
    23
    You can make it so that when the sphere collides with the cube, in either OnTriggerEnter() or OnCollisionEnter() and when this happens, you add the cube to a variable, assign it somewhere, and then destroy the in-game object. :)
     
  3. EVenus1

    EVenus1

    Joined:
    Mar 31, 2015
    Posts:
    16
    i dont understand
     
  4. EVenus1

    EVenus1

    Joined:
    Mar 31, 2015
    Posts:
    16
    plz hep