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

Prefab with button inside

Discussion in 'UGUI & TextMesh Pro' started by jjuam, Jan 14, 2016.

  1. jjuam

    jjuam

    Joined:
    Jun 12, 2015
    Posts:
    51
    Hi everybody. I want to create a prefab, but I want to include a canvas button inside the prefab. How can I do that?

    Thanks a lot in advance!!
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    jjuam: Hi there!

    How about just add a button to your canvas, then drag it from there to Asset windows and you have your prefab?
     
  3. jjuam

    jjuam

    Joined:
    Jun 12, 2015
    Posts:
    51
    Thanks for your reply!!

    Finally I have created a quad prefab, and inside a script with a raycast to control when the new prefab is pressed.
    Now works fine!