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. Dismiss Notice

Question 3d Buttons For Repeated Use

Discussion in 'Scripting' started by Kickapk, Aug 26, 2023.

  1. Kickapk

    Kickapk

    Joined:
    Mar 7, 2021
    Posts:
    35
    I am thinking about hopping back into Unity. It has been awhile.

    I want to make a basic script for a 3d button prefab that will trigger when pressed and play an animation of it being pressed. That should be easy for me.

    However, I want these buttons to be reusable for all sorts of things. What would be the best way to go about that? One button might open a specific door. Another might be used as part of a puzzle.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Start with any 3D button tutorial perhaps?

    Screen Shot 2023-08-26 at 1.42.06 PM.png



    Drag it into place and connect it up in scene, pretty much like all other Unity inter-object communication.