Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Game Development Essentials

Discussion in 'Community Learning & Teaching' started by Merries, Jul 28, 2009.

  1. Merries

    Merries

    Joined:
    Feb 2, 2009
    Posts:
    262
    I started this thread for those of us who have picked up Will Goldstone's Unity Game Development Essentials book. This is for observations, problems or discussions on the book.
     
  2. Merries

    Merries

    Joined:
    Feb 2, 2009
    Posts:
    262
    I have emailed Will on this problem I ran into in Chapter 4 but I thought I would drop it out to the community to comment on or offers solutions.

    In Chapter 4 your have the outpost model and are scripting to be able to open / close the door with character collision.

    I built the script as written and had no errors in it. But when I take my character up to bump into the door nothing happens. I am using the first method, entering the extended boundary of the door.

    Ive attached the script written just in case it is something in the script.
     

    Attached Files:

  3. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359
    I've only glanced at your source, but Mike asked if I could post:

    Hope that helps,
     
  4. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    I hit a very similar snag in chapt 4.

    Did Will get back to you? Having a printed section with the final code would have been mighty helpful.

    B.
     
  5. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    You can download all unity packages from all chapters from the packtpub.com site if you login, but I could not find any scripts in them only models, textures, sounds, ...
    In the same location you can find errata but there were none at this time of writing.
     
  6. superherogeek

    superherogeek

    Joined:
    May 22, 2009
    Posts:
    26
    In Chap. 5 there don't seem to be the battery textures he refers to. Thinking that they may have been mixed into another package, I just imported all of them, but there is no texture folder in any of them. Did anyone else have this problem?
     
  7. superherogeek

    superherogeek

    Joined:
    May 22, 2009
    Posts:
    26
    I have a question on Ch. 6 that I'm hoping one of you can answer. In the coconut script there is a line
    Code (csharp):
    1.  newCoconut.rigidbody.velocity = transform.
    I thought the period at the end was a typo, but I guess it wasn't. I've never seen a line with a period before. Does anyone know why it ends with a period instead of a semicolon?
     
  8. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Merries, Brendang - Arges is right you're simply missing the starting capital O there. For the rest of you posting in here - the chapters are being redrafted as I right this.. well obivously i've taken a quick break to reply, but otherwise i'm on it. I have several people, some from the Unity team and other trusted Unity experts picking me up on omissions and procedural issues throughout the chapters, so they will be fixed as soon as humanly possible.

    Superherogeek - In Chapter 6 you're misreading the book, there simply isn't enough room on that line for the entire line of code - its all one thing - lines of code end as you point out with a semi-colon, I just check the ebook which I assume you're referring to, you just need the rest of the line there.

    Sorry for the inconvenience to you guys I promise i'm working as fast as I can to finalize these chapters - also working with the publisher to get the assets onto the site - they have all the assets so i'm not sure if / why the battery texture wouldn't be available - please let me know if this is still an issue you're having.

    All the best

    Will
     
  9. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Thanks Will,

    The book, even in it's RAW form, is a terrific learning tool and idea sparker. We're simply getting a preview peek behind the curtain which is a rare thing. I'd much prefer a lil errata here and there than waiting till October for the polished version.

    The one suggestion (plea actually), I'd make is, after a section of assembling code with the 'Now add this to the Bottom, and then add this" approach would be to have what the final script should look like at the end of that section. That way we can troubleshoot ourselves.

    best,
    B
     
  10. Augustum

    Augustum

    Joined:
    Feb 11, 2008
    Posts:
    55
    This book is great! Haven't gotten through very much yet, just wanted to follow this thread. :D
     
  11. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    Can't get the door to close completly on the outpost. I don't think it is the script.

    Maybe it come from something else, there is alot of manipulation of the outpost to do.
     
  12. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    Same for me :(
     
  13. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    same here with the door. Think I need a carpenter...
     
  14. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    lol. For the battery I copy the book image and made .jpg out of it and import as new asset. I would post here but I am not sure Will would appreciate?
     
  15. bobber205

    bobber205

    Joined:
    May 12, 2009
    Posts:
    139
    Anyone know where to download the sounds for the ambient music for Chapter 2? Was quite bummed when all I could download was the code off the site.

    EDIT:
    Nevermind. :)
    Found it in another folder that wasnt chapter 2.
     
  16. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    I purchased the RAW ebook a couple days ago and I'm finding it very valuable so far...however, I echo some of the sentiments mentioned earlier, most notably:

    1. Not being able to find the battery textures for the GUI. Can't really advance in the book until I get these...

    2. For the outpost, my door doesn't close all the way as well. This isn't major but it'd be worth figuring out what the problem is.

    3. typos typos typos! These aren't major, though :)

    Finally, I found some of the explanations a bit vague. Most notably when writing the script for the outpost's door activation. I think this would be remedied with that section ending with a full printing of what the whole script should look like, and not just little parts of it.

    Great book! Although the lack of battery PNGs are definitely annoying. They're not part of the battery pack and I've imported all the files on the website.

    Help anyone? :(
     
  17. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    Ya some stuff is vague, and the FPC script description is not at right place in the book. Some explanations are clear as water. You can send email to him, hope he change it.

    For the battery you can cut paste images from the book, it look horrible, but it dose the job.
    Or just create 5 images
    0 - 1 - 2 - 3 FULL

    :p
     
  18. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    err.. what page is the picture on? do you mean page 116? where it shows the project view and you can see the tiny thumbnail? That's the only pic I can find :S

    If so, how do you make the (white) background transparent? I'm using GIMP and/or microsoft paint..
     
  19. Dan Mills

    Dan Mills

    Joined:
    Aug 17, 2008
    Posts:
    50
    Well yeah I noticed that too but just kinda made my own in PShop; I'm sure the assets package can be updated pretty quickly.

    Yeah here is a problem since we are learning, this could do with fixing; it's I am guessing in the animation? But see that I am guessing... so yes fix needed.



    I agree that the final code (all of it) should be present at the end of each coding example... for a concise reference.. given
     
  20. Dan Mills

    Dan Mills

    Joined:
    Aug 17, 2008
    Posts:
    50
    Here is my final code for the player script in C# for those who are translating learning :)

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerCollisions : MonoBehaviour
    5.    
    6. {
    7.  
    8.     //Declare two public variables for sound clips visible in Unity Inspector to assist assigning door sounds for open / shut in editor
    9.     public AudioClip doorOpenSound;
    10.     public AudioClip doorCloseSound;
    11.  
    12.     // Declare two variables; for a state check 'doorIsOpen' (true or false); and 'doorTimer'
    13.     //to be used to shut the door after an amount of value + Time.deltatime (to keep synced to frame rate) becomes more than 3 secs  
    14.     float doorTimer = 0;
    15.     bool doorIsOpen = false;
    16.    
    17.     // Use this for initialization
    18.     void Start()
    19.     {
    20.         // Nothing to do here yet
    21.     }
    22.  
    23.     // Update is called once per frame
    24.     void Update()
    25.     {
    26.         // Using Raycast technique as to opposed collider checking 'OnColliderHit()' technique that is described in Chapter 4
    27.  
    28.         RaycastHit hit;
    29.         if (Physics.Raycast(transform.position, transform.forward, out hit, 5))
    30.         {
    31.             if (hit.collider.gameObject.tag == "outpostDoor"  doorIsOpen == false)
    32.             {
    33.                 Door(doorOpenSound, true, "dooropen");
    34.             }
    35.         }
    36.  
    37.         if (doorIsOpen)
    38.         {
    39.             doorTimer += Time.deltaTime;
    40.             if (doorTimer > 3)
    41.             {
    42.                 Door(doorCloseSound, false, "doorshut");
    43.                 doorTimer = 0;
    44.             }
    45.         }
    46.     }
    47.  
    48.     /*original if statement calling the method 'shutDoor' for shutting the door after 3 secs,
    49.      * now we use new method 'Door' passing arguments to the method 'Door(AudioClip aClip, bool openCheck, string animName)'
    50.      * to be received as parameters for that method named 'Door'
    51.      *
    52.      if (doorTimer > 3)
    53.         {
    54.            shutDoor();
    55.             doorTimer = 0;
    56.         }
    57. }
    58. */
    59.  
    60. /* TEMP COMMENTED OUT WHILST USING RAYCASTING METHOD IN Update() METHOD INSTEAD
    61. void OnControllerColliderHit (ControllerColliderHit hit)
    62. {
    63.    if (hit.gameObject.tag == "outpostDoor"  doorIsOpen == false)
    64.    openDoor();  
    65.        
    66. }          
    67. */
    68.  
    69.     /* TEMP INACTIVE AS WE REPLACE THE openDoor() METHOD WITH ONE THAT PASSES ARGUMENTS TO PARAMETERS IN THE METHOD 'Door'
    70.   void openDoor()
    71.    {
    72.        audio.PlayOneShot(doorOpenSound);
    73.        doorIsOpen = true;
    74.        GameObject myOutpost = GameObject.Find("outpost");
    75.        myOutpost.animation.Play("dooropen");
    76.    }
    77.    */
    78.  
    79.     // TEMP INACTIVE AS WE REPLACE THE shutDoor() METHOD WITH ONE THAT PASSES ARGUMENTS TO PARAMETERS IN THE METHOD 'Door'
    80.     /*void shutDoor()
    81.     {
    82.         audio.PlayOneShot(doorCloseSound);
    83.         doorIsOpen = false;
    84.         GameObject myOutpost = GameObject.Find("outpost");
    85.         myOutpost.animation.Play("doorshut");
    86.     }
    87.     */
    88.  
    89.     void Door(AudioClip aClip, bool openCheck, string animName)
    90.     {
    91.         audio.PlayOneShot(aClip);
    92.         doorIsOpen = openCheck;
    93.         GameObject myOutpost = GameObject.Find("outpost");
    94.         myOutpost.animation.Play(animName);
    95.     }
    96. }
    97.  
     
  21. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    Thanks Dan, well have a question, is all script starting with using UnityEngine; are in C#
     
  22. Dan Mills

    Dan Mills

    Joined:
    Aug 17, 2008
    Posts:
    50
    No the examples given in the RAW Ebook are in UnityScript (JScript if you like) I used it to learn C# by translating the UnityScript into C#... there are a few threads on Will's EBook so I'll post it in the others also... mods need to merge these topics me thinks :wink:
     
  23. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    ^agreed that these topics should be merged.

    That said, I was wondering if someone could post the full javascript coding for the Player Collisions script.
    I'm having difficulty following Will's explanations sometimes. I've got an "error" popping up at the bottom of the screen and I can't seem to see what my problem is...

    I'm at the point where I'm trying to make the battery GUI appear when you reach the door while not having enough batteries and then have the GUI disappear once you've gotten all batteries and entered through the door once (Chapter 5).
    The error at the bottom of the screen says:
    "NullReferenceException: Object reference not set to an instance of an object"

    here is my coding for this section:

    Code (csharp):
    1.  
    2. var batteryCollect : AudioClip;
    3.  
    4. private var doorIsOpen : boolean = false;
    5. private var doorTimer : float = 0.0;
    6. var doorOpenSound : AudioClip;
    7. var doorShutSound : AudioClip;
    8. function Update () {
    9. var hit : RaycastHit;
    10.     if (Physics.Raycast (transform.position, transform.forward, hit, 5))
    11.     {
    12.     if(hit.collider.gameObject.tag=="outpostDoor"  doorIsOpen == false  BatteryCollect.charge == 4) {
    13.             Door(doorOpenSound, true, "dooropen");
    14.             GameObject.Find("Battery GUI").GetComponent(GUITexture).enabled=false;}
    15.             }
    16.            
    17.         else if(hit.collider.gameObject.tag=="outpostDoor"  doorIsOpen == false  BatteryCollect.charge < 4) {
    18.         GameObject.Find("Battery GUI").GetComponent(GUITexture).enabled=true;} 
    19.            
    20.             if(doorIsOpen){
    21.             doorTimer += Time.deltaTime;
    22.            
    23.     if(doorTimer > 3){
    24.         Door(doorShutSound, false, "doorshut");
    25.         doorTimer = 0.0;
    26.         }
    27.     }
    28. }
    29. /*function OnControllerColliderHit(hit : ControllerColliderHit) {
    30. if(hit.gameObject.tag  == "outpostDoor"  doorIsOpen == false) {
    31. Door(doorOpenSound, true, "dooropen");
    32. }
    33. }
    34. */
    35.     function Door(aClip : AudioClip, openCheck : boolean, animName : String) {
    36.         audio.PlayOneShot(aClip);
    37.         doorIsOpen = openCheck;
    38.         var myOutpost : GameObject = GameObject.Find("outpost");
    39.         myOutpost.animation.Play(animName);
    40.         }
    41. function OnTriggerEnter(collisionInfo : Collider){if(collisionInfo.gameObject.tag == "battery"){
    42. BatteryCollect.charge++;
    43. audio.PlayOneShot(batteryCollect);
    44. Destroy(collisionInfo.gameObject);
    45. }
    46. }      
    47. @script RequireComponent(AudioSource)
    as you can probably tell, this is my first time coding.. =/

    My problem is that the Battery GUI doesn't show up when I approach the house. Everything else works fine.
     
  24. melmonkey

    melmonkey

    Joined:
    Mar 31, 2009
    Posts:
    373
    Well, the above sections of the code are what stand out to me as potential causes of the error you're seeing.

    That error means that the code is expecting you to provide an instance (reference to an object) that is needed by the code to complete its work.

    The three variables above need to have a reference to an AudioClip dragged onto them in the inspector.

    Look at the error next time and it should provide the script name and line number that is causing the issue. That should help you track it down.
     
  25. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    Thanks for the quick reply. I've played around with it and yes, those three variables have all been assigned a specific sound.
    Here is the full error message:
    So it says line 17 doesn't have a proper instance.. this is my line 17:

    Code (csharp):
    1.  
    2.     else if(hit.collider.gameObject.tag=="outpostDoor"  doorIsOpen == false  BatteryCollect.charge < 4) {
    3.       GameObject.Find("Battery GUI").GetComponent(GUITexture).enabled=true;}    
    4.          
    5.          if(doorIsOpen){
    6.          doorTimer += Time.deltaTime;
    All the variables are assigned to proper instances, as far as I can tell...

    My main problem is that I'm trying to make it so that when you approach the outpost without having gathered any batteries, the battery GUI will appear in the corner. But this never happens.
     
  26. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    @Rainville, I love Ontario. But I live Québec.

    Boo.Lang.Runtime.RuntimeServices

    Here is your problem. Create a java script then copy your script in it, anyway JS have a better debugger right now.

    Verify all your scripts are in JS, if no change them, the book is all JS.
     
  27. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    Man, I was just in Montreal earlier today!!

    I noticed that "boo" line too, but all my scripts are JS files. Not too sure what's happening here.. I did a couple of these chapter's from Will's book while on a fairly rocky bus (towards/from Montreal) so I imagine I've simply made an error earlier in the chapter at some point. Restarting will probably do me good!

    Thanks for the help everyone :)
     
  28. filmcraft

    filmcraft

    Joined:
    May 26, 2006
    Posts:
    109
    I second posting the scripts
     
  29. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Hi all, just checking book related threads to bring you news that my book on Unity is finally finished, and is heading to the printers this week, designed for beginners to get them kickstarted you can find out about it here..

    http://www.packtpub.com/unity-game-development-essentials/book

    hope it helps some of you out!

    all the best

    Will
     
  30. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    Well in that case here's my errata, which I had sent you some time ago. Pitty that none(?) of it is included in the final book. Maybe it's useful for the readers:
    page : typo/error

    39 : Next select the Grass and Dirt texture -> Next select the Grass and Rock texture
    46: to open the Sound folder -> to open the Sounds folder
    77: last codesnippet must be:
    if (speed >= 6) {
    //do something
    }
    else if (speed >= 3) {
    //do something
    }
    ...

    because else if speed is like 10 it will never reach the second if!

    78: Mutliple conditions -> Multiple conditions
    81/82: the 2 code screenshots are not the same (see line 2). On page 82 when you're deconstructing the script you use "var jumpSpeed = 8.0;"
    99: "... rather than writing many individual scripts that checking for the same object." is not correct English/grammar ?!
    112: in the code snippet you use 5 for the length of the ray but when explaining the code on the last line on the page you use length 3
    113: the first code snippet has to be: hit.collider.gamObject.tag == "outpostDoor"
    113 115: in the summary on 113 you mention keycards to be collected but on page 115 it's batteries

    page: comment

    11 : in the section "Polygons, Vertexes, Points and Meshes": what's the difference between a Vertex and a Point? Also when you say "the location at which these vertexes meet are known as Points"... isn't it where these lines meet are known as Points/Vertexes?!
    I find the lines "Polygon triangles.... are known as Points" confusing.
    47 : in the note you mention that you will look further into skybox creation in chapter 9 but I couldn't find it.
    52: calculate normals: "the normal is the forward facing surface" is not correct. Every surface has a normal and when this normalvector is pointing towards the viewer (that means the angle between the viewing vector and normal vector is less than 90 degrees) the surface is pointing to you and so it's visible and should not be culled.
    52: smoothing angle: you mention hard edge but don't explain what it is
    58: i don't think it's correct if you compare tags with instance name in Flash. Tags can be used on many instances in Unity and an instance name is (or should be) unique.
    62: top of the page: "we are telling it to be at the centre of its parent" -> this is not always true. the origin of the parent is not always in the centre. You should say it's on the origin of the parent.
    75: just above the section OnMouseDown you give some examples of the Update function: Applying force to a rocket. But on page 81 you use FixedUpdate to apply gravity, which I think is the correct way to do it.
    83: in the last code snippet you use, for the first time, the keyword new but don't explain what this is or does. On page 118 when calling the Rotate function you don't use new. So that's confusing for the reader.
    102: in the section "Writing Custom Functions" you compare parameters with behaviour but I think it's just information which could represent behaviour is more appropiate. For example in a function Sum(i: int;j:int) I certaintly won't say i and j are behaviours.

    page : typo/error
    139: missing point in end of sentence: "...have a knocked down and reset animation."
    151: in the first line of code -> throwVelocity has to be throwForce (see page 153)
    155: second code -> "if(Input.GetButtonUp("Fire1")){" has no code style applied (and no indention)
    156: second paragraph from the bottom is missing style bold(compare it with for example page 148 last paragraph)
    163: just above Make more targets -> we'll make two more targets instead of three
    169: "File > Save" misses style bold
    169: "... to update your progress so far" instead of "...thus far"?!
    169: in Summary: "We have looked at:" remove dash at the end!
    169: last sentence: "...create a fire for our outpost..."
    175: second list of bullets, last bullet: "Material folders for the 3D model" instead of "...models". It's just one model: campfire right?
    182: third bullet (first list of bullets) is missing a comma (0.1, 0, 0.1)
    185: in the code below on the page: "var matchGUIobj : GameObject = Instantiate....."
    185: last code line move it a tab to the left (too much indented)
    187: several code lines in the second code listing have too many tab / too much indent (same as on page 185)
    189: In Summary -> change "...used two particle systems" into "...using two..." !?

    page: comment
    122: in "Positioning the GUI texture" you mention since a long time "screen coordinates". Maybe a pointer back to page 70 as a reminder would help/refresh the mind of the reader.
    123: in the first picture it would be better to include the whole picture and/or put the X/Y axis along the picture. Now it looks like the battery is at (0.05, 0.4)
    164: at the top of the page I would recommend a small screenshot of the hierarchy how it should look like after duplicating the targets.
    177-180: I found this section hard to understand as there were some magic numbers. Also I could not understand World Velocity vs Local Velocity (page 177), Simulate in Worldspace, difference between force (179) and tangent velocity(178) because they both give a boost. Also Camera Velocity Scale, Length Scale, Velocity Scale was a bit vague.
    I guess you could write a book alone on the subject of particles :)
    180: Could not understand from what I read what you mean by "...with a soft render of the texture we apply"?

    page : typo/error
    196: "The first variable we will use to specify which scene will load the button" -> "The first variable we will use to specify which scene will load when the button"
    198: "... and go to Component | Scripts | MainMenuBtns" -> "... and go to Component | Scripts | Main Menu Btns"
    198: "In the LevelToLoad variable" -> "In the levelToLoad variable"
    204: "... at the bottom of the script -" -> "... at the bottom of the script:"
    207: last sentence should be "We'll be creating..."
    217: "...at the top of the Inspector for this object-" -> "...at the top of the Inspector for this object:"
    220/221/225: StartTime variable shoud be startTime variable
    221: "...which our lerp provides..." -> "...which our Lerp provides.."
    221: "...so placing this in a Start() function..." -> Start() is missing style/font
    225: in first code section a wrong "same or greater" operator is used. It should be: if (Time.time >= 5) {

    page: comment
    218: "As we already adjusted the Far Clip Plane settings previously" -> could not find this! You only mention it in page 70 but I can't find where you adjusted it?!

    page : typo/error
    234: "...it should look like this -" ->"...it should look like this:"
    235: "...now have the following -" -> "...now have the following:"
    241: in line 2: enabled -> enable

    half way page 14:
    "Simple - the rigidbody component has a variable called Physic Material..."
    must be
    "Simple - the collider component has a variable called Physic Material..."
    See also http://unity3d.com/support/documentation/ScriptReference/Collider-material.html
     
  31. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Hi Jan

    well actually we did go over all of your errata, and hopefully corrected where appropriate, how exactly are you able to tell what is in the final book which has not yet been printed or made available in PDF form?

    Will
     
  32. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    I checked these first 5 typos/errors (see my previous posts):
    and they are all not corrected. I have checked it with the latest book I just downloaded from packtpub:
    Current RAW Publication: September 2009
    RAW Production Reference: 3100909
     
  33. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Jan

    The PDF version of the book will be updated with the last set of changes when the book is published later this week I'm told by the publisher. The technical editors and I read over yours and all other readers errata and between us we should have corrected what you have sent, please wait and be sure before assumed we have ignored you, I appreciate your help.

    Will
     
  34. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    just bought,where i can get the resources files?in my invoice only available the ebook :(,i cann't found the link to download resources/assets files.

    [edit]
    found it here : http://www.packtpub.com/support
     
  35. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    Well that explains why I thought none of my errata that I sent was in the latest downloaded pdf :)
     
  36. oliver_l1

    oliver_l1

    Joined:
    Oct 5, 2009
    Posts:
    4
    hi will,

    not sure if i should by this book.is this the printed version of the unity tutorials on learnmesilly.com ? also there's no "table of contents" on the packt side.i need more infos about the book.

    Kind Regards,
    Oliver
     
  37. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    Me Too!

    Getting lost over what goes where with the alterations!
     
  38. Merries

    Merries

    Joined:
    Feb 2, 2009
    Posts:
    262
    Actually if you go to your drive and look in the assets folder for the project the scripts are in there.
     
  39. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Hi guys, we have sample scripts in the assets bundle you download from Packt you know... in case there is any confusion.

    Will
     
  40. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    Hi Will,

    You do, but, and maybe I need to look harder, I could only find the finished scripts with all the various things in for battery collection and so on and this makes it hard for the beginner to tease out the specific functions for the earlier lessons. Do not worry, we'll get there.

    It is interesting about the bug in the animation for the door opening script.
    I applied the same script to a door animation I had made myself in C4D and while it does work, again there is a misplay in the animation in the game, although it's fine in C4D and I've tried everything I can think of. In this case it is the dooropen part of the animation. The door flies off to a 180 degree point never animated in one frame, it returns to the correct position and works perfectly for the door close part of the script. Weird!
     
  41. jnbutler

    jnbutler

    Joined:
    Dec 1, 2009
    Posts:
    16
    Will
    I have ran into a slight problem while following chapt 2. In the book when you are creating the terrain from scratch page 28 Create Lightmap dialog. Your dialog shows an Element attribute that is a dropdown box but in my Unity that dropdown box is not populate. I can't choose Directional light (Light) since there is nothing there only None!
    Did I miss something or do I need some other package?
    Please help so I can continue with the book.
    Regards.....

    Edit: btw, I'm using Unity version 2.6.0f7 (29850)
    on Windows 7
     
  42. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Hi James

    Its an example picture! there is no light there because you have not added it to your scene yet - that part of the book is just explaining the terrain menu. You will add the light on page 50 once you've started creating the terrain.

    All the best

    Will
     
  43. jnbutler

    jnbutler

    Joined:
    Dec 1, 2009
    Posts:
    16
    Thanks Will, I thought I had really missed something or had messed up my Unity install.

    Regards...
     
  44. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    I've redone my door animation in Unitys new Animation Editor and it now works perfectly!

    Thanks.
     
  45. jnbutler

    jnbutler

    Joined:
    Dec 1, 2009
    Posts:
    16
    Ok, I started creating the terrain at page 37 e-book, and the Terrain (Script) section will not let me set the brush opacity to 0.5. When I type in 0.5 and press enter it sets it back to 0.

    I also tried to continue with an opacity of 1 and I can't get anything to show on the terrain when I hold down the shift key and paint around the edges. Nothing happens!! This is really frustrating!!! :x
     
  46. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    James,

    sounds like a bug. Always update to the latest version. Earlier you listen 2.6.0f3, the latest version is 2.6.1, go get it and check if they fixed the bug! let me know

    Will
     
  47. jnbutler

    jnbutler

    Joined:
    Dec 1, 2009
    Posts:
    16
    Installed the 2.6.1 version and it messed up badly, now it doesn't display anything in the scene and game views even with the Island Demo loaded. I have posted about this in the support forum.
     
  48. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    James

    often some such problems can be solved with a 'Reimport All assets' - its in the assets menu I think, not got unity open right now so can't check

    Will
     
  49. jnbutler

    jnbutler

    Joined:
    Dec 1, 2009
    Posts:
    16
    Dummy me, I didn't have a scene open in the Island Demo, doh!
    I'm going to shut up now and see if I can learn this thing better than this....... :oops:
     
  50. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Hehe, fair enough man, happens to us all, have fun! :)