Create a Logic script
Instructions on how to set up a Logic script.
Read time 1 minuteLast updated 2 days ago
Add Logic scripts to your objects to give them interactivity and new behaviors. This information explains how to create a new Logic script. There are two ways to create a new Logic script:
From the Inspector panel
It's useful to add a Logic component to a GameObject from the Inspector panel because the Logic script automatically attaches to that object.- Select a GameObject in your scene. The Inspector panel shows.
- Select Add Component.
- In the NEW LOGIC section, enter a name of your new Logic script.
- Select Create and Edit, or press the Enter key.
From the Project panel
To create a Logic script from the Project panel:- In the Project panel, select the My Logic folder.
- Select Add (+).
- Select New Script. Unity Lite creates a new Logic script in the folder.
- Enter a name for your script and press Enter.
- Double-click the new script to open the Logic Editor.