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

How to address instantiate objects at runtime?

Discussion in 'Scripting' started by DeepShader, Mar 3, 2015.

  1. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    682
    Hello,
    I build a little script to build instances of an object in a ScrollView at runtime, but how can I address this objects from a script at runtime?

    I need a way to give the user the option to remove a selected object. Selection means = the one, which shows in the middle of the ScrollView (such as you got a scroll-menu with all your game-saves, like a slot-machine, and the entry which is shown in the middle can be deleted/removed by clicking on a delete-button.

    So I need a way to figure out, which object is shown at this point and a way to delete this special GameObject.

    Can anybody help? It drives me crazy :D
     
  2. honprovet

    honprovet

    Joined:
    Mar 4, 2014
    Posts:
    23