Unity+Tips

=Unity Tips =

  **__ Unity Tips __** This page will be a place where you can find various tips to help you as you learn Unity. If you have a helpful hint to share with the class please e-mail me at:TStern@Hatboro-Horsham.org and I will add it to the page.

Start Search: Unity Find your project .unity OR Create New Project
 * How to open Unity: **

File, Save Scene File, Save Project Name Scene Note: save to the default destination that appears (asset folder)
 * To Save your project: **
 * REMEMBER TO NAME YOUR PROJECT so you can go back to it **

A. Check the position of the camera… · Is it far away from where you want it? · Is there an object inside the camera/is the camera inside an object? · Is the camera above or below where you want it (especially important with terrains)? B. Is the camera turned on?  ** Downloading Assets:  ** · In order to download assets you must create and account. · ONLY download free assets, · When downloading, make sure you are out of the Unity Program (save you work) · Log onto the Unity assets store · Download you FREE asset ** Below is a more detail explanation to download your assets  ** A. Check all the boxes in the new project start up… · Did you go through and check them all? If not then you need to upload your assets. B. Assets · Save and close Unity (save scene, save project) · If you have an asset store account, open up the asset store, go to the asset store, find the ** *FREE* ** asset you want. -Make sure you have the correct version on Unity to download that asset. · Click the asset name, wait for it to load, click “Open in Unity”, let Unity open by itself and an in Unity asset store window will open on top of Unity with a button saying “Download”. · Click that button and it will say “Please Wait” and start a count to 100%. –Depending on how large the asset is, it may take longer to start the download, and the download itself may be longer. · Once at 100%, it will open up a new mini window that compresses the data for the asset, then opens a new window that says “Cancel” or “Import” (If you regret downloading the asset you can cancel the import). · Import the asset and it will start loading the asset one more time (this may take a bit of time as well). Once loaded, close the Unity asset store and the normal Unity screen will be there and the asset will be in Unity for you. · Some assets are pre-scripted or come with scripts. This further adds resources to your game, and allows you to make objects do different things.  ** It won’t let you save in your “z” drive…  ** · There is not enough space to accommodate all the date in you Z drive. · Therefore, we save it to our desktop; you may also bring in a thumb drive with at least 1TB of space. · You won’t be able to access your saved project anywhere else, because only the computers in this class have the program loaded. · OR just save it in the premade Unity folder; in will open up to the scene you were last working on every time you open Unity.  ** If you can’t find the object you want…  ** A. It is far away… · Take the X, Y, and Z position of an object you know is in the right place and put them into the object’s you cannot see(the object will be in the hierarchy). B. It might be too small… · Raise the X, Y, and Z scale to a high number. *All three scale sizes must be the same.* C. If you just want to know where a lost object is, double click the object’s name in the hierarchy.  ** If you can’t find an object or asset you just downloaded…  ** A. In the search bar in the assets area, type in what you are looking for; it will search for it. B. Go into the assets section of the Unity main screen and scroll up to the top of the list. It will have a “Favorites” and under it will say “All Materials”, “All Models”, “All Prefabs”, and “All Scripts”. · ** Materials  ** are all the different textures and skins you have in Unity. · ** Models  ** are all the *unscripted*, premade things you have in Unity. · ** Prefabs  ** are all the *pre-scripted*, premade things you have in Unity. · ** Scripts  ** are all the actions and reactions are other technical things.  ** If your game is too dark when you press play…  ** A. Did you put in a light source? · Go into “GameObject”, “Create Other”, and click “Directional Light” (this will light up the whole scene). · A “Point Light” will only light up a certain area. · A “Spot Light” will only shine in what it’s pointed at. B. You can edit all three light’s intensity, color, shadow rendering, and so on in the “Inspector” section on the Unity main screen. ** NOTE:“Area Light” requires the Pro version of Unity to work. **  ** Changing background color  ** A. You can change the color of the background… · Click on the “Main Camera” and next to “Background” there will be a dark blue box. Click the box and a color map will pop up, use this to change the color, OR add a SkyBox. B. You can add a SkyBox… · Press “Edit”, “Render Settings”, over at the inspector section, it will say “Skybox Material” and have a little circle with a dot in the center. Click the circle and a window will open showing you all your materials. *If you didn’t check all the boxes when you started the project, you might not have any skyboxes.* · Scroll down to the material you want as your skybox and double click it. The “Sunny Skyboxes” and other skyboxes are in the “S” section of that window.  <span style="border: none; mso-border-top-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0in 0in 0in; padding: 0in;">** To change the material of an object in your game  ** · Click the object you want colored · Go to the assets section and click “All Materials”, and go down to whatever material you want. · Drag that material to the object you want colored.
 * If the camera isn’t showing anything **
 * If you need more assets **

<span style="border-top: solid windowtext 1.0pt; border: none; display: block; mso-border-top-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 0in 0in 0in;"> <span style="border: none; mso-border-top-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0in 0in 0in; padding: 0in;">** To add and change a terrain  ** A. Click “GameObject”, “Create Other”, and click “Terrain”. · You can move the terrain to where ever you want it to be. B. To edit the height and shape of the terrain · In the inspector section, there will be little pictures, one of them being a mountain with an up arrow, another being a mountain with an up and down arrow. · <span style="height: 29px; left: 0px; margin-left: 150px; margin-top: 42px; position: absolute; width: 48px; z-index: 6;"> <span style="height: 27px; left: 0px; margin-left: 148px; margin-top: 0px; position: absolute; width: 37px; z-index: 5;"> The first picture is used to raise the terrain. · <span style="height: 27px; left: 0px; margin-left: 145px; margin-top: 44px; position: absolute; width: 44px; z-index: 7;"> The second picture is used to raise the terrain to a certain height. · The third picture is used to smooth out anything in the terrain. C. <span style="height: 34px; left: 0px; margin-left: 297px; margin-top: 15px; position: absolute; width: 47px; z-index: 8;"> To edit the texture of the terrain… · Click the paint brush tool (the click “Edit Textures”, “Add Texture…” and go to the newly opened window and click select on one of the boxes.   · Then scroll down to whatever texture you want to use.    NOTE:*Again this depends on if you checked all the boxes in the project start up or not.*  <span style="border-top: solid windowtext 1.0pt; border: none; display: block; mso-border-top-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 0in 0in 0in;"> <span style="border: none; mso-border-top-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0in 0in 0in; padding: 0in;">**  If you’re having trouble editing camera  **   A. In the upper-right corner of the Scene View is the Scene Gizmo .    · <span style="height: 109px; left: 0px; margin-left: -16px; margin-top: 6px; position: absolute; width: 96px; z-index: -1;"> This displays the Scene Camera's current orientation, and allows you to quickly modify the viewing angle. · Right under the Scene Gizmo is a barely visible word saying either “Persp” or “Iso”. You can change from “Persp” to “Iso” by clicking on the word. · Each of the "arms" of the gizmo represents a geometric axis. You can click on any of the arms to set the camera to various views. You can click on the text underneath the gizmo to switch between the normal perspective view and an isometric view. · While in isometric mode, you can right-click drag to orbit, and Alt + middle-click drag to pan. · When using “Persp”, the camera will pivot from where it is, moving the map around. · When using “Iso”, the map will pivot from where it is, moving the camera around. <span style="border-top: solid windowtext 1.0pt; border: none; display: block; mso-border-top-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 0in 0in 0in;"> <span style="border: none; mso-border-top-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0in 0in 0in; padding: 0in;">** If you can’t find the arrows to move an object  ** · In the top left corner of Unity there are four little pictures. Click on the second picture and the arrows will come back. <span style="border-top: solid windowtext 1.0pt; border: none; display: block; mso-border-top-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 0in 0in 0in;"> <span style="border: none; mso-border-top-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0in 0in 0in; padding: 0in;">** If you want to make an object to move and/or be attached to another object  ** · Go to the hierarchy · Find the objects you want (both the one you want to connect and the one you want it to connect to). · Drag the object you want to connect into the object you want it to be connected to.