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

Question Instantiate different prefabs in a list (with dedicated button for each prefab)

Discussion in 'Prefabs' started by flintstone24, Oct 17, 2022.

  1. flintstone24

    flintstone24

    Joined:
    Jul 4, 2022
    Posts:
    2
    Hello Everyone,
    While working on a task. I was stuck with the following.
    I would like to instantiate the prefabs like an executable list (more like a task timeline)as shown in the image (Grey shapes are prefabs) on clicking the respective button for run, walk,etc. Also, if a prefab like exercise is selected, it should lead to the user selecting two more prefabs under the prefab (as shown in the image for exercise). This list should be made editable later i.e to delete a prefab and reorder the list or duplicate a prefab.

    img.png

    Any help would be appreciated. Thanks in advance.
     
  2. unity_XxDR0uE_a7o8EA

    unity_XxDR0uE_a7o8EA

    Joined:
    Jun 2, 2019
    Posts:
    1
    Can you please clarify where exactly you are stuck? And what should happen when i click on the Exercise Button? Should it instantiate the Run-prefab as well as the Walk-Prefab`?
     
  3. flintstone24

    flintstone24

    Joined:
    Jul 4, 2022
    Posts:
    2
    I´m exactly not sure how to instantiate the prefabs in a list with different buttons. When the user clicks the exercise button he should be able to select two more prefabs (more like an if else .... if the exercise is walk or run in this case) consider it more like two empty slots where the next two inputs go in.