Create a variable
Instructions on how to create a variable for your Logic script.
阅读时间1 分钟最后更新于 19 天前
Create variables to store data that your Logic script can use and modify. Remember to assign any references after creating variables.
To create a variable, use the following steps:
- Open your Logic script.
- Select the Add (+) icon next to Variables. The New Variable window appears.
- Change the settings to your preferences.
- Select Create.
Assign references
To set variable values:
- Select your GameObject that has your Logic attached. The Inspector panel shows.
- In the Inspector, find your Logic.
- Either set the variable value, or drag an object from the Hierarchy panel into the variable slot.