From the course: Unity: Interactivity for AEC

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create variables in scripts

Create variables in scripts - Unity Tutorial

From the course: Unity: Interactivity for AEC

Start my 1-month free trial

Create variables in scripts

- Let's go ahead and start programming our script. Now, I want all my scripts to live in the scripts folder. My script list may be a little bit different from what you're seeing, but let's go ahead and create a new script. So we're going to go to assets, create, c-sharp script and that should create a blank script in that scripts folder. So let's go ahead and name this swap text, and then I'm just going to give it a number 01, and I'm going to increment this so you can see how this script is built. And then let's double-click on that and bring it up in MODO develop. So this a blank script. Now if you notice, Unity has put in a couple of things here. It's given us some header information here, as well as our start and update function. Now we're not ready for the start and update function right now, but we do need to start declaring variables. Variables in c-sharp can take on a number of different forms but if you use a variable, you should declare it up front before you use it. So, in…

Contents