Search Unity

Unity 3 Video Training Course (FREE) - Walker Boys

Discussion in 'Community Learning & Teaching' started by profcwalker, Dec 8, 2010.

  1. NeverConvex

    NeverConvex

    Joined:
    Jun 26, 2013
    Posts:
    88
    Brand new to game development. Loving these videos.

    But: videos 1-19 to 1-29 seem to be missing? The series jumps from 1-18 to 1-30. Apologies if this has been addressed already; didn't want to read the full 60 pages of thread, heh :)
     
  2. RenegadeNinjaNL

    RenegadeNinjaNL

    Joined:
    May 23, 2013
    Posts:
    22
    I assume you are watching the videos on Vimeo. The best solution I can recommend is to ignore the numbers/names for the videos on Vimeo. I was confused by that initially as well.

    What I did was use the Walker Boys website to open the videos by using the video series list. This way I knew I was watching the right video and it made it easy to keep track of what I have watched.
     
  3. apomarinov1

    apomarinov1

    Joined:
    Oct 21, 2012
    Posts:
    66
    Hey renegade, just a little tip on your 2d shooter. Prewarm the stars particle system so you dont see how the stars come on the screen when you start the level :)
     
  4. RenegadeNinjaNL

    RenegadeNinjaNL

    Joined:
    May 23, 2013
    Posts:
    22
    @apomarinov1 Thanks for the tip, I will update the shooter with that change
     
  5. Maklaud

    Maklaud

    Joined:
    Apr 2, 2013
    Posts:
    551
    After some (wasted) time of learning and watching these videos, I can't help leaving my comment.
    Guys, sorry, but your tutorials are just nothing. After creating my first game I have learned a lot more than after watching your Lab 1 and Lab 2 together!
    Lab 3 is just copying some code from the Internet (line-by-line!).
    Lab 4 is just a set of fully completed prefabs, scenes, etc. And now I have to think why Unity shows errors about blender, how you created these prefabs and the most important - why you did exactly like that!

    I think you should have created more fully explained tutorials, like "create plane, add textures, add character controller, create a scene like this etc", but no, you have just given a ready set of scenes without any explanation and say this is a great tutorials.

    Just waste of time, sorry.
     
  6. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    I enjoyed this comment so much, thought I'd say hello. And of course to leave my signature around ;)
     
  7. SaiNagata

    SaiNagata

    Joined:
    Jun 30, 2013
    Posts:
    2
    Wow... Thanks
    It's Very Help Me. To Learn UNITY...
     
  8. Maklaud

    Maklaud

    Joined:
    Apr 2, 2013
    Posts:
    551
    Who has completed Lab 4?
    apomarinov1, it seems you have. Can you help, please? I don't want to use ready scenes, so I try to reconstruct them.
    I have taken one texture (tile brick 2 solid) from the archive (it has size 256*256), then I create a plane (with Unity size (1, 1, 1)), added a box collider instead of a plane collider - I don't know why, but it has size (10, 10, 10) to make it fit the plane. And I created a prefab, using all of this staff. Then I add prefabs to my scene and they have size (10, 10, 10), but I thing they should be (1, 1, 1).

    If we look at them in the ready scenes, they have unity size (0.5, 0.5, 0.5) and box collider (1, 1, 1). Why do I have such a big difference?
     
  9. RenegadeNinjaNL

    RenegadeNinjaNL

    Joined:
    May 23, 2013
    Posts:
    22
    Stuck on Lab 4 on Part 31: Fireball.

    The fireball and all the particles work fine. However the fireball doesn't bounce and just rolls across the floor. The only time the fireball bounces is if I jump and then shoot a fireball. There has been no errors on my console and I have been stuck on this for couple of days now.

    Below is the code to the projectileFireball.js file.
    Code (csharp):
    1.  
    2. // Fireball Projectile
    3.  
    4. var moveSpeed            : float = 1.0;        // set the speed of the projectile
    5. var bounceHeight        : float = 0.25;        // set the height limit for the projectile
    6. var lifespan            : float = 1.0;        // set the time before object is destroyed
    7. var smokePuff            : Transform;        // load particle
    8. var hitPosition            : float = 0.0;        // set the location of projectile when it hits something
    9. var bounceUp            : boolean = false;    // set direction of the fireball
    10. var heightDifference    : float = 0.0;        // get difference between the current position and the hit position
    11.  
    12. function Start()
    13. {
    14.     KillFireball();
    15. }
    16.  
    17. function Update()
    18. {
    19.     if (bounceUp)
    20.     {
    21.         transform.Translate(moveSpeed * Time.deltaTime, 0.75 * Time.deltaTime, 0);    // move the object for the up direction
    22.         heightDifference = transform.position.y - hitPosition;    // get the difference between where it hit and it was
    23.        
    24.         if (bounceHeight <= heightDifference)    // did it reach height limit
    25.         {
    26.             bounceUp = false;    // send fireball back down
    27.         }
    28.     }
    29.     else
    30.     {
    31.         transform.Translate(moveSpeed * Time.deltaTime, -1.0 * Time.deltaTime, 0); // move the object for the down direction
    32.     }
    33. }
    34.  
    35. function OnTriggerEnter(other : Collider)
    36. {
    37. // print(other.transform.tag);
    38.     if (other.transform.tag == "Untagged")    // check for what to collide with
    39.     {
    40.         var hit : RaycastHit;
    41.        
    42.         if (Physics.Raycast(transform.position.Vector3(1, 0, 0), hit, 0.1) || Physics.Raycast(transform.position.Vector3(-1, 0, 0), hit, 0.1))    // check for raycast hit left and right of the fireball
    43.         {
    44.             ParticlePlay();
    45.             Destroy(gameObject);    // remove the object if it hits a wall
    46.         }
    47.         else
    48.         {
    49.             bounceUp = true;    // move the fireball up
    50.             hitPosition = transform.position.y;    // store the location where it hit (y)
    51.         }
    52.     }
    53.    
    54.     if (other.transform.tag == "enemy")
    55.     {
    56.         ParticlePlay();
    57.         Destroy(other.gameObject);
    58.         Destroy(gameObject);
    59.     }
    60. }
    61.  
    62. function KillFireball()
    63. {
    64.     ParticlePlay();
    65.     Destroy(gameObject, lifespan);
    66. }
    67.  
    68. function ParticlePlay()
    69. {
    70.     if (smokePuff)
    71.     {
    72.         Instantiate(smokePuff, transform.position, transform.rotation);
    73.     }
    74. }
    75.  
    I have noticed that when I shoot the fireball, it does not print out the Untagged objects (which should be all the bricks on the floor). I still can't seem to find what the error is and any help would be much appreciated.
     
  10. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    392
    A link to my second labo portfolio
    First labo is also on there.
     
  11. Maklaud

    Maklaud

    Joined:
    Apr 2, 2013
    Posts:
    551
    Is there anybody alive? Walkerboys, you have created weak tutorials, and you don't even answer in your topic as well. Good for you! :)
     
    Last edited: Jul 5, 2013
  12. albuquezi

    albuquezi

    Joined:
    Mar 28, 2013
    Posts:
    2
    Hi Guys,

    a new Unity learner here that has found the Walker Boys challenges.

    Here goes my try at Lab 1 Project.
    http://albuquezi.tumblr.com/
    I've made my lab project report more like a blog. Hope you enjoy reading it. Feel free to comment!

    Cheers

    José
     
  13. RenegadeNinjaNL

    RenegadeNinjaNL

    Joined:
    May 23, 2013
    Posts:
    22
    Completed lab project 04.

    To play the game for lab 04, click here.
     
    Last edited: Jul 8, 2013
  14. clearrose

    clearrose

    Joined:
    Oct 24, 2012
    Posts:
    349
    Hello guys I'm been stuck on one line of code in lab one. I did fix my original errors but now I keep getting a NUll reference error and I've tried many different version of the code to make it work but it always circles back to the null error. Heres my player code, it doesn't seem to like line 26 in my player script.

    Heres the error:

    NullReferenceException: Object reference not set to an instance of an object
    Scriptplayer.Update () (at Assets/Scripts/Scriptplayer.js:26)

    PlayerScript:

    Code (csharp):
    1. var tagName : String;
    2. var rayDistance : float = 0;
    3.  
    4. //Private Variables
    5.  
    6.  
    7. function Update ()
    8. {
    9.     if(Input.GetMouseButtonDown(0))
    10.     {
    11.         print("yay I pressed the button down");
    12.         var hit : RaycastHit;
    13.         var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    14.        
    15.         if(Physics.Raycast(ray, hit, rayDistance))
    16.         {
    17.             print("Hit that Object");
    18.            
    19.             if(hit.transform.tag == tagName)
    20.             {
    21.                 var enemyScript : ScriptEnemy = hit.transform.GetComponent(ScriptEnemy);
    22.                 enemyScript.numberofClicks--;
    23.             }
    24.            
    25.             else
    26.             {
    27.                 print("This is not an enemy");
    28.             }
    29.         }
    30.     }
    31. }
    and my Enemy Script:

    Code (csharp):
    1. var numberofClicks : int = 2;
    2. var respawnWaitTime : float = 2.0;
    3. var explosion       : Transform;
    4. //Private Variables
    5. private var storeClicks : int = 0;
    6.  
    7. function start ()
    8. {
    9.     storeclicks = numberofClicks;
    10. }
    11.  
    12. //Update is called every frame
    13. function Update ()
    14. {
    15.     if(numberofClicks <= 0)
    16.     {
    17.         if(explosion)
    18.         {
    19.             Instantiate(explosion, transform.position, transform.rotation);
    20.         }
    21.        
    22.         var position = Vector3 (Random.Range(-6, 6),Random.Range(-4, 4),0);
    23.         RespawnWaitTime ();
    24.         transform.position = position;
    25.         numberofClicks = storeClicks;
    26.         print("Enemy hit!");
    27.     }  
    28. }
    29.  
    30. function RespawnWaitTime ()
    31. {
    32.     renderer.enabled = false;
    33.     yield WaitForSeconds (respawnWaitTime);
    34.     renderer.enabled = true;
    35. }
    Also, a thread I started in the scripts forum a few days ago to get some help. It has more information on the problem:

    http://forum.unity3d.com/threads/189827-Noob-Unknown-identifier-problem
     
    Last edited: Jul 11, 2013
  15. profcwalker

    profcwalker

    Joined:
    May 3, 2009
    Posts:
    243
    Hi Clearrose,

    I would guess looking at the code above, the variable or getcomponent needs something. :)

    In enemy script:
    var numberofClicks : int = 2;
    change to:
    public var numberofClicks : int = 2;

    If that doesn't fix it, then you may need "" on the GetComponent("ScriptEnemy"); in the player script.

    Hope that helps.
     
  16. tra2002

    tra2002

    Joined:
    May 11, 2011
    Posts:
    142
    Also make sure you enemies are tagged
    Code (csharp):
    1.  
    2. if(hit.transform.tag == tagName)
    3.  
    so the enemy would be tagName

    but if
    Code (csharp):
    1.  
    2. if(hit.transform.tag == "Enemy")
    3.  
    then as long as your enmies where tagged Enemy would work
     
  17. clearrose

    clearrose

    Joined:
    Oct 24, 2012
    Posts:
    349
    Sadly I tried your advice ProCWalker and Tra2002's advice as well and they didn't work out. However when I tried a suggestion from Ereous on another thread well it did get raid of the error but the solution bypasses the enemy scripts functions all together.So I think it has has something to with the Enemy script making the null error occur while the player script is trying to access it.

    Heres what Ereous suggested:

    Code (csharp):
    1. var myEnemyScript: ScriptEnemy  = hit.transform.GetComponent(ScriptEnemy);
    2.  
    3.  
    4.  
    5. //We don't want to access the script if its null.. Something when wrong when we attempt to grab the reference
    6.  
    7. if(myEnemyScript != null){
    8.  
    9.     myEnemyScript.numberOfClicks -= 1;
    10.  
    11. }
    So I need to find what in the Enemy script is causing the Error. Anyways thanks guys for all your help so far, hopefully soon the problem can be fixed.
     
  18. clearrose

    clearrose

    Joined:
    Oct 24, 2012
    Posts:
    349
    Guess what guys, I fixed my problem. It had nothing to do with code, I put the script enemy in the wrong place.

    $Picture 2.png

    I put the script on "EnemyDroneOrefab", so I moved the enemy script to "PolySurface8". the game worked and all is well !!! YAY !!! I can't believe such a silly stupid mistake would set me back soooo much and for soooo long.

    Well thanks to those who helped me, so far this has been a great learning experience. Hopefully I can get Lab 1 finished soon.
     
  19. sidegame

    sidegame

    Joined:
    Feb 28, 2013
    Posts:
    24
    Dear Profcwalker,

    Thank you very much for your AMAZING tutorials, I really didn't know how easily I learned Unity with your tutorials and I really enjoy watching/ learning all the videos specially the techniques you use in Scripting and how to use the Scripting reference and all the others.
    I have a small suggestion, is it possible to make a training project for iPhone (Third Person Controller , Touch button, Joystick and etc… ) just like 3D Mario project, I know that there is one in Unity Store (Penelope), but that is in (.pdf) not in video and it’s pretty hard/boring to read hundreds of pages.

    Thanks,

    Sincerely,

    GameSide
     
  20. RenegadeNinjaNL

    RenegadeNinjaNL

    Joined:
    May 23, 2013
    Posts:
    22
    Completed lab project 05.
    To play the game for lab 05, click here.
     
  21. bpleffner

    bpleffner

    Joined:
    Jun 16, 2013
    Posts:
    10
    Hello everyone. Thank you to the Walker Boys for a great tutorial series on Unity! I have been progressing through the series and have now completed the first Lab Project this afternoon. To see my version of the lab project, please follow this link.
     
  22. oldcollins

    oldcollins

    Joined:
    Aug 3, 2012
    Posts:
    111
    hi there i'm having a problem with the lab 4 part 34 block states 1 here's the script + error
    Code (csharp):
    1.  
    2. enum BlockType  { blockBounce, blockCoin, blockBreakable, blockSolid, blockQuestion }
    3. enum PickUpType { pickupMushroomGrow, pickupMushroomLife, pickupFireFlower}
    4. enum BreakType  { breakableGeometry, breakableParticles }
    5.  
    6. var BlockState                          : BlockType;
    7. var BlockStateAfter                     : BlockType;
    8. var PickupState                         : PickUpType;
    9. var BreakState                          : BreakType;
    10.  
    11. var blockCoinAmount                     : int           = 3;
    12. var blockQuestionScrollSpeed            : float         = 0.5;
    13.  
    14. var materialBlock1                      : Material;
    15. var materialBlock2                      : Material;
    16. var materialBlock3                      : Material;
    17. var materialBlock4                      : Material;
    18.  
    19. var pickupCoin                          : Transform;
    20. var pickupMushroomGrow                  : Transform;
    21. var pickupMushroomLife                  : Transform;
    22. var pickupFireFlower                    : Transform;
    23. var breakableGeometry                   : Transform;
    24. var breakableParticles                  : Transform;
    25.  
    26. var soundBump                           : AudioClip;
    27. var soundPickup                         : AudioClip;
    28.  
    29. private var breakablePos                : Vector3;
    30. private var pickupPos                   : Vector3;
    31. private var coinPos                     : Vector3;
    32. private var blockAni                    : boolean       = false;
    33. private var coinMove                    : boolean       = false;
    34. private var blockCoinAmountReset        : int;
    35.  
    36. function OnTriggerEnter ( other : Collider )
    37. {
    38.     if ( other.tag == "collisionBoxHead" )
    39.     {
    40.         blockAni = true;
    41.     }
    42. }
    43. function Start ()
    44. {
    45.     coinPos      = Vector3 ( transform.position.x, transform.position.y, transform.position.z + .2);
    46.     breakablePos = Vector3 ( transform.position.x, transform.position.y + .25, transform.position.z - 9);
    47. }
    48. function Update ()
    49. {
    50.     switch (BlockState)
    51.     {
    52.         case BlockState.blockBounce :
    53.             renderer.material = materialBlock1;
    54.             if (blockAni)
    55.             {
    56.                 animation.Play ( "blockBounce");
    57.                 blockAni = false;
    58.                 audio.Play ();
    59.             }
    60.         break;
    61.         case BlockState.blockCoin :
    62.         renderer.material = materialBlock1;
    63.         if (blockAni)
    64.         {
    65.             animation.Play ( "blockBounce");
    66.             var coin = Instantiate ( pickupCoin, coinPos, transform.rotation );
    67.             blockAni = false;
    68.             blockCoinAmount --;
    69.             audio.clip = soundBump;
    70.             audio.Play ();
    71.         }
    72.         break;
    73.         case BlockState.blockBreakable:
    74.         renderer.material = materialBlock1;
    75.         if (blockAni)
    76.         {
    77.             animation.Play ( "blockBounce");
    78.             if ( BreakState == BreakState.breakablegeometry )
    79.             {
    80.                 Instantiate ( breakableGeometry, breakablePos, transform.rotation );
    81.             }
    82.             if ( BreakState == BreakState.breakableParticels )
    83.             {
    84.                 Instantiate ( breakableParticles, transform.position, transform.rotation );
    85.             }
    86.             Destroy ( transform.parent.gameObject);
    87.             blockAni = false;
    88.         }
    89.         break;
    90.         case BlockState.blockSolid:
    91.         renderer.material = materialBlock2;
    92.         if ( blockAni)
    93.         {
    94.             audio.clip = soundBump;
    95.             audio.Play ();
    96.             blockAni = false;
    97.         }
    98.         break;
    99.         case BlockState.blockQuestione:
    100.         break;
    101.     }
    102.    
    103. }
    104.  
    errors

    Assets/2D Mario Assets/Scripts/blockBump.js(78,41): BCE0051: Operator '==' cannot be used with a left hand side of type 'BreakType' and a right hand side of type 'System.Object'.

    Assets/2D Mario Assets/Scripts/blockBump.js(82,41): BCE0051: Operator '==' cannot be used with a left hand side of type 'BreakType' and a right hand side of type 'System.Object'

    Assets/2D Mario Assets/Scripts/blockBump.js(50,9): BCE0051: Operator '==' cannot be used with a left hand side of type 'BlockType' and a right hand side of type 'System.Object'.


    so can anyone help me out please
     
  23. bpleffner

    bpleffner

    Joined:
    Jun 16, 2013
    Posts:
    10
    I can't test it at the moment, but you have, "BreakState == BreakState.breakablegeometry" and "BreakState == BreakState.breakableParticels". Shouldn't those be "BreakState == BreakType.breakablegeometry" and "BreakState == BreakType.breakableParticels".
     
  24. oldcollins

    oldcollins

    Joined:
    Aug 3, 2012
    Posts:
    111
    i've had a look at the video and that's how the script looks in the video and i try the ""BreakState == BreakType.breakablegeometry" and the "BreakState == BreakType.breakableParticels". and still the same errors came up
     
  25. bpleffner

    bpleffner

    Joined:
    Jun 16, 2013
    Posts:
    10
    Also, there are a couple of inadvertent typos. In the conditional statements, you have .breakablegeometry and your enumeration is .breakableGeometry, missed the capital G. For .breakableParticels it should be .breakableParticles, the l and e are switched. On line 88, there is an extra e at the end of .blockQuestion.
     
    Last edited: Jul 17, 2013
  26. oldcollins

    oldcollins

    Joined:
    Aug 3, 2012
    Posts:
    111
    thanks for that
     
  27. bpleffner

    bpleffner

    Joined:
    Jun 16, 2013
    Posts:
    10
    My second tutorial project is done, a version of space shooters called, Block Shooter.
     
  28. RenegadeNinjaNL

    RenegadeNinjaNL

    Joined:
    May 23, 2013
    Posts:
    22
    It would help if you post the code you are having trouble with
     
  29. valhalla_cats

    valhalla_cats

    Joined:
    Jan 27, 2013
    Posts:
    16
    Hi, I am trying to play an animation only once in order to improve the Mario 2D Side Scroller animation system. Any ideas of how to do it?
    Thanks a lot!
     
  30. kamal2013thapa

    kamal2013thapa

    Joined:
    Apr 16, 2013
    Posts:
    3
    hi, oldcollins

    set var BlockState : int;
    at line77 88 replace the code
    if ( BreakState == BreakState.breakableGeometry)

    if ( BreakState == BreakState.breakableParticles )

    Now, it should work.
    Thanks
     
  31. jlarmesto

    jlarmesto

    Joined:
    Jul 22, 2013
    Posts:
    4
    Hello. Thank you to the Walker Boys for this great tutorial. I recently completed the first Lab project. You can access if you click here.

    I have to improve my English communication skills. If you find some sentence or word with no meaning, let me know.

    Thank you again!
     
  32. oldcollins

    oldcollins

    Joined:
    Aug 3, 2012
    Posts:
    111
    hi there i keep getting these errors on this script

    1) NullReferenceException
    colliderAttackBox.Start () (at Assets/2D Mario Assets/Scripts/colliderAttackBox.js:18)

    2) NullReferenceException
    colliderAttackBox+$HitRight$78+$.MoveNext () (at Assets/2D Mario Assets/Scripts/colliderAttackBox.js:67)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
    colliderAttackBox:Update() (at Assets/2D Mario Assets/Scripts/colliderAttackBox.js:23)

    3) NullReferenceException: Object reference not set to an instance of an object
    Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
    UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
    colliderAttackBox.HitDead () (at Assets/2D Mario Assets/Scripts/colliderAttackBox.js:73)
    colliderAttackBox.Update () (at Assets/2D Mario Assets/Scripts/colliderAttackBox.js:24)





    Code (csharp):
    1. var hitDistance         : float         = 3.0;
    2. var hitTime             : float         = 0.2;
    3. var hitSound            : AudioClip;
    4. var deadSound           : AudioClip;
    5.  
    6. private var playerLink  : GameObject;
    7. private var hitLeft     : boolean       = false;
    8. private var hitRight    : boolean       = false;
    9. //private var hitDead       : boolean       = false;
    10. private var changeState : boolean       = false;
    11. private var soundRate   : float         = 0.0;
    12. private var pProp;
    13.  
    14. function Start ()
    15. {
    16.     playerLink = GameObject.Find ("Player");
    17.     pProp = playerLink.GetComponent(playerProperties);
    18. }
    19. function Update ()
    20. {
    21.     HitLeft ();
    22.     HitRight ();
    23.     HitDead ();
    24.     ChangePlayerState();
    25. }
    26. function OnTriggerEnter (other : Collider)
    27. {
    28.     if(other.tag == "enemyCollisonleft")
    29.     {
    30.         hitLeft = true;
    31.     }
    32.     if (other.tag == "enemyCollisonRight")
    33.     {
    34.         hitRight = true;   
    35.     }
    36. }
    37. function OnTriggerExit (other:Collider)
    38. {
    39.     if(other.tag == "enemyCollisonleft")
    40.     {
    41.         yield WaitForSeconds (hitTime);
    42.         hitLeft = false;
    43.         changeState = true;
    44.     }
    45.     if (other.tag == "enemyCollisonRight")
    46.     {
    47.         yield WaitForSeconds (hitTime);
    48.         hitRight = false;
    49.         changeState = true;    
    50.     }
    51. }
    52. function HitLeft ()
    53. {
    54.     if (hitLeft)
    55.     {
    56.         PlaySound ( hitSound, 0 );
    57.         playerLink.transform.Translate ( -hitDistance * Time.deltaTime, hitDistance * Time.deltaTime, 0);
    58.         yield WaitForSeconds (hitTime);
    59.     }
    60. }
    61. function HitRight ()
    62. {
    63.     if (hitRight)
    64.     {
    65.         PlaySound ( hitSound, 0 );
    66.         playerLink.transform.Translate ( hitDistance * Time.deltaTime, hitDistance * Time.deltaTime, 0);
    67.         yield WaitForSeconds (hitTime);
    68.     }
    69. }
    70. function HitDead ()
    71. {
    72.     if( ( hitRight || hitLeft )  pProp.playerState == 1)
    73.     {
    74.         changeState = true;
    75.     }
    76. }
    77. function ChangePlayerState ()
    78. {
    79.     if (changeState)
    80.     {
    81.         if (pProp.playerState == 0)
    82.         {
    83.             pProp.playerState = PlayerState.MarioSmall;
    84.             pProp = changeMario = true;
    85.         }
    86.         else if (pProp.playerState == 1)
    87.         {
    88.             pProp.dead = true;
    89.             pProp.playerState = PlayerState.MarioDead;
    90.             pProp = changeMario = true;
    91.             PlaySound ( deadSound, 0);     
    92.         }
    93.         else if (pProp.playerState == 2)
    94.         {
    95.             pProp.playerState = PlayerState.MarioSmall;
    96.             pProp.changeMario = true;
    97.         }
    98.         else if (pProp.playerState == 3)
    99.         {
    100.             pProp.playerState = PlayerState.MarioLarge;
    101.             pProp = changeMario = true;    
    102.         }
    103.         changeState = false;
    104.     }
    105. }
    106. function PlaySound(soundName, soundDelay)
    107. {
    108.  if ( !audio.isPlaying  Time.time > soundRate )
    109.      {
    110.         soundRate = Time.time + soundDelay;
    111.         audio.clip = soundName;
    112.         audio.Play();
    113.         yield WaitForSeconds ( audio.clip.length );
    114.     }
    115. }
    any help would be great thanks



    this is the playerproperties.js


    Code (csharp):
    1. // Player Properties Component
    2. // Description: Set and stores pickups and state of player
    3.  
    4. enum PlayerState
    5. {
    6.     MarioDead    = 0,                       // the player is dead
    7.     MarioSmall   = 1,                       // sets the size of mario to small
    8.     MarioLarge   = 2,                       //sets the size of mario to large
    9.     MarioFire    = 3                        // enable the fireball power
    10.      
    11. }
    12.  
    13. var playerState = PlayerState.MarioSmall;    // set the display sytate of mario in the inspector
    14.  
    15. var lives                 :int      = 3;     // sets number of lives
    16. var key                   :int      = 0;     //
    17. var coins                 :int      = 0;
    18. var projectileFire        : GameObject;
    19. var projectileSocketRight : Transform;
    20. var projectileSocketLeft  : Transform;
    21. var materialMarioStandard : Material;
    22. var materialMarioFire     : Material;
    23.  
    24. var changeMario           : boolean  = false;
    25. var hasFire               : boolean  = false;
    26.  
    27. var soundDie : AudioClip;
    28. private var soundRate : float   = 0.0;
    29. private var soundDelay : float = 0.0;
    30.  
    31. private var coinLife      : int      = 20;
    32. private var canShoot      : boolean  = false;
    33. private var dead          : boolean  = false;
    34.  
    35.  
    36.  
    37.  function Update()
    38.  
    39.     {
    40.      var playerControls = GetComponent ( "playerControls" );
    41.      PlayerLives ();
    42.     if ( changeMario )
    43.    
    44.         {
    45.             SetPlayerState ();
    46.         }
    47.     if ( canShoot)
    48.     {
    49.         var clone;
    50.         if ( Input.GetButtonDown ("Fire2") projectileFire  playerControls.moveDirection == 0 )
    51.             {
    52.                 clone = Instantiate (projectileFire, projectileSocketLeft.transform.position, transform.rotation );
    53.                 //clone.rigidbody.AddForce ( -90, 0, 0 );
    54.                 clone.GetComponent (projectileFireball).moveSpeed = -2.0;
    55.               }
    56.              
    57.         if ( Input.GetButtonDown ("Fire2") projectileFire  playerControls.moveDirection == 1 )
    58.             {
    59.                 clone = Instantiate (projectileFire, projectileSocketRight.transform.position, transform.rotation );
    60.                 //clone.rigidbody.AddForce ( 90, 0, 0 );
    61.                 clone.GetComponent (projectileFireball).moveSpeed = 2.0;
    62.              }             
    63.     }
    64.     else return;
    65. }
    66.  function AddKeys ( numKey : int)
    67.     {
    68.         key += numKey;
    69.     }
    70. function AddCoin ( numCoin : int)
    71.     {
    72.     coins = coins + numCoin;
    73.     }
    74. function SetPlayerState ()
    75.     {
    76.         var playerControls = GetComponent ( "playerControls" );
    77.         var charController = GetComponent ( CharacterController );
    78.    
    79.         switch ( playerState )
    80.         {
    81.             case PlayerState.MarioSmall :
    82.                 playerControls.gravity = 0.0;
    83.                 transform.Translate ( 0, .2, 0 );
    84.                 transform.localScale = Vector3 ( 1.0, 0.75, 1.0);
    85.                 charController.height = 0.45;
    86.                 transform.renderer.material = materialMarioStandard;
    87.                 playerControls.gravity = 20.0;
    88.                 canShoot = false;
    89.                 changeMario = false;
    90.                 break;
    91.             case PlayerState.MarioLarge :
    92.                 playerControls.gravity = 0.0;
    93.                 transform.Translate ( 0, .2, 0 );
    94.                 transform.localScale = Vector3 ( 1.0, 1.0, 1.0);
    95.                 charController.height = 0.5;
    96.                 transform.renderer.material = materialMarioStandard;
    97.                 playerControls.gravity = 20.0;
    98.                 canShoot = false;
    99.                 changeMario = false;
    100.                 break;
    101.             case PlayerState.MarioFire  :
    102.                 playerControls.gravity = 0.0;
    103.                 transform.Translate ( 0, .2, 0 );
    104.                 transform.localScale = Vector3 ( 1.0, 1.0, 1.0);
    105.                 charController.height = 0.5;
    106.                 transform.renderer.material = materialMarioFire;
    107.                 canShoot = true;
    108.                 playerControls.gravity = 20.0;
    109.                 changeMario = false;
    110.                 break;
    111.             case PlayerState.MarioDead  :
    112.             playerControls.gravity = 0.0;
    113.             this.transform.Translate (0, 3 * Time.deltaTime, 0);
    114.             this.transform.position.z = -1;
    115.             yield WaitForSeconds ( .4);
    116.             playerControls.gavity = 20.0;
    117.             yield WaitForSeconds (2);
    118.             if ( dead)
    119.             {
    120.                 lives --;
    121.                 this.transform.position = GetComponent ( spawnSaveSetup ).curSavePos;
    122.                 playerState = playerState.MarioSmall;
    123.                 changeMario = true;
    124.                 dead = false;              
    125.             }          
    126.             changeMario = false;
    127.                 break;
    128.         }  
    129. }
    130. function PlaySound(soundName, soundDelay)
    131. {
    132.  if ( !audio.isPlaying  Time.time > soundRate )
    133.      {
    134.         soundRate = Time.time + soundDelay;
    135.         audio.clip = soundName;
    136.         audio.Play();
    137.         yield WaitForSeconds ( audio.clip.length );
    138.     }
    139. }
    140. function PlayerLives ()
    141. {
    142.     if (lives == 0)
    143.     {
    144.         PlaySound( soundDie, 0);
    145.         yield WaitForSeconds ( 3 );
    146.         Application.LoadLevel ( "2D mario Screen Lose");
    147.     }
    148. }
     
    Last edited: Jul 25, 2013
  33. clearrose

    clearrose

    Joined:
    Oct 24, 2012
    Posts:
    349
    Hello, all I'm glad to say that I'm finally ready to show what I've been working on !! This is my finished my Lab o1 project for the walker bros tutorials class thing.

    WebPlayer:

    http://dl.dropboxusercontent.com/u/184682845/DroneExplosion.html

    Your Name: Nova Jumer

    Timeframe: Not share I did allot of extra work then shown in the videos.

    Project Detail - Made a point and click, fast paced game, with an sci-fi theme.

    Software Used: Unity, maya, topogun (for drone meshes), zbrush, photoshop.

    Final Thoughts - A great learning experience for sure. definitely at the moments of frustration when the code I typed after watching the videos won't work and I have to do hours of research to fix the problems...): . but I would do it again in a heartbeat, and I look forward to lab 02 !!

    Break down your Time: N/A

    ScreenShots:

    $Picture 1.png

    $Picture 3.png

    Credits:

    Game made by me: Nova Jumer

    Thanks to:

    walkerboystudio.com

    the awesome people at the unity forums.

    Freesounds.org

    quaintproject.wordpress.com for the countdown tutorial for unity.

    http://incompetech.com for the royalty free music

    and cgtextures.com.
     
  34. bpleffner

    bpleffner

    Joined:
    Jun 16, 2013
    Posts:
    10
    For any that might be interested follow this link to my website to view my blog post regarding the Walker Boys Project Number 3. The blog post explains my folder structure that I create and has a representative web player build of the Time Tester. As requested by the project instructions, the time tester uses functions.
     
  35. kamal2013thapa

    kamal2013thapa

    Joined:
    Apr 16, 2013
    Posts:
    3
    Thanks, I replaced mine playerpropertise.js from above.I found it is much better. player won't jitter.On collision with gumba,Change State won't go in to function Update.But unfortunately, on first Collision, player lives reduced twice or thrice(not constant reduction of live). also player is not falling from wall before going to dead State.

    CollisionBoxAttack. js is already attached on this page.

    Thanks
     
  36. oldcollins

    oldcollins

    Joined:
    Aug 3, 2012
    Posts:
    111

    I'm still have the errors with collisionattackbox.js any help would be great
     
  37. kamal2013thapa

    kamal2013thapa

    Joined:
    Apr 16, 2013
    Posts:
    3
    Hi oldcollins

    var hitDistance : float = 3; //set force to push player back
    var hitTime : float = 0.2; //set time duration for push
    var hitSound : AudioClip; //hit sound
    var deadSound : AudioClip; //die audio

    private var playLink : GameObject; //connect to player
    private var hitLeft : boolean = false; //left collision on/off switch
    private var hitRight : boolean = false; //right collision on/off switch
    private var changeState :boolean = false; //to change playerState on/off
    private var soundRate : float = 0.0; //curren time + delay time
    private var soundDelay : float = 0.0; // delay amount of time
    private var pProp ; // connect playerproperties.js


    function Start ()
    {
    playLink = GameObject.Find( "player" ); //search player char
    pProp = playLink.GetComponent (playerProperties); //accessing script
    }
    function Update ()
    {
    HitLeft ();
    HitRight();
    HitDead ();
    ChangePlayerState ();
    }
    function OnTriggerEnter ( other : Collider ) //check for collision start
    {
    if (other.transform.tag == "enemyCollisionLeft" ) //checking tag for enemy's Collider
    {
    hitLeft = true; //allows to bounce back LHS
    }
    if (other.transform.tag == "enemyCollisionRight" ) //checking tag for enemy's Collider
    {
    hitRight = true; //allows to bounce back RHS
    }
    }
    function OnTriggerExit ( other : Collider ) //check for colllider leaving
    {
    if (other.tag == "enemyCollisionLeft" ) //checking tag for enemy's Collider
    {
    yield WaitForSeconds ( hitTime); //wait to Change State
    hitLeft = false; //don't allow to bounce
    changeState = true; //allows to change playerStates,
    }
    if (other.tag == "enemyCollisionRight" ) //checking tag for enemy's Collider
    {
    yield WaitForSeconds ( hitTime); //wait to Change State
    hitRight = false; //don't allow to bounce
    changeState = true; //allows to change playerStates,
    }
    }
    function HitLeft () //palyer getting hit on LHS bounce back
    {
    if (hitLeft) //check for bounce Back
    {
    PlaySound (hitSound, 0);
    playLink.transform.Translate ( -hitDistance * Time.deltaTime, hitDistance * Time.deltaTime, 0 ); //move backward with height
    yield WaitForSeconds ( hitTime); // bounce back duration
    }
    }
    function HitRight () //palyer getting hit on RHS
    {
    if (hitRight) //check for bounce Back
    {
    PlaySound (hitSound, 0);
    playLink.transform.Translate ( hitDistance * Time.deltaTime, hitDistance * Time.deltaTime, 0 ); //move backward with height
    yield WaitForSeconds ( hitTime); // bounce back duration
    }
    }
    function HitDead () //player getting Hit from any side
    {
    if (( hitRight || hitLeft) pProp.playerState == 1 )
    {
    changeState = true; //allows to change playerState
    }
    }
    function ChangePlayerState () //change playerState
    {
    if (changeState)
    {
    if (pProp.playerState == 0 ) //check playerState to "MarioDead"
    {
    pProp.playerState = PlayerState.MarioSmall; // set mario to small
    pProp.changeMario = true; //allows to change playerState
    }
    else if (pProp.playerState == 1 ) //check playerState to "MarioSmall"
    {
    pProp.dead = true;
    pProp.playerState = PlayerState.MarioDead; // set mario to Dead
    pProp.changeMario = true;
    PlaySound (deadSound, 0); //allows to change playerState
    }
    else if (pProp.playerState == 2) //check playerState to "MarioLarge"
    {
    pProp.playerState = PlayerState.MarioSmall; // set mario to small
    pProp.changeMario = true; //allows to change playerState
    }
    else if (pProp.playerState == 3) //check playerState to "MarioFire"
    {
    pProp.playerState = PlayerState.MarioLarge; // set mario to small
    pProp.changeMario = true; //allows to change playerState
    }

    changeMario = false; //if above conditions are false then don’t change playerStates
    }
    }

    function PlaySound(soundName, soundDelay)
    {
    if( !audio.isPlaying Time.time > soundRate )
    {
    soundRate = Time.time + soundDelay;
    audio.clip = soundName;
    audio.Play ();
    yield WaitForSeconds (audio.clip.length);
    }
    }

    Thanks
     
    Last edited: Jul 29, 2013
  38. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    cool. good to go
     
  39. IsaacF

    IsaacF

    Joined:
    Oct 14, 2012
    Posts:
    1
    Hi I've been looking through the video list and I think some of them are missing or have broken links. Just didn't want to start if some of the material is missing.

    Thanks
     
  40. jlarmesto

    jlarmesto

    Joined:
    Jul 22, 2013
    Posts:
    4
    Hi Isaac,

    I've been watching all the videos from lab 1 to lab 4 and I did'nt find any material missing. Could you please post these broken links?
     
  41. jlarmesto

    jlarmesto

    Joined:
    Jul 22, 2013
    Posts:
    4
    Last edited: Oct 6, 2014
  42. aviler

    aviler

    Joined:
    Aug 1, 2013
    Posts:
    1
    Hi everyone!
    I just started the Lab 4 project - 2D Mario Clone, but when I tried to open the project on Unity 4.1.5 some compiler errors appear, probably because of the conversion Unity did on the project files. The errors are:

    Assets/Standard Assets/Image Effects (Pro Only)/MotionBlur.cs(10,27): error CS0246: The type or namespace name `ImageEffectBase' could not be found. Are you missing a using directive or an assembly reference?

    Assets/Standard Assets/Image Effects (Pro Only)/Crease.js(11,22): BCE0018: The name 'PostEffectsBase' does not denote a valid type ('not found').

    How to solve this errors? I can't wait to make my mario clone =D

    tnx
     
  43. Focuzed

    Focuzed

    Joined:
    Jul 21, 2013
    Posts:
    16
    How effective is this course being 2 years old now? It's not updated I am assuming?
     
  44. Focuzed

    Focuzed

    Joined:
    Jul 21, 2013
    Posts:
    16
    Supposed to be such a huge community but yet 20 hours and not a single response? Yup, HUGE community that are so helpful and friendly.
     
  45. TehPudding

    TehPudding

    Joined:
    May 7, 2013
    Posts:
    2
  46. Dothackking

    Dothackking

    Joined:
    Sep 10, 2012
    Posts:
    52
    I tried this course my first time trying to learn Unity. I liked it's practicality, but it had so many problems due to age, videos not being sorted, etc that I couldn't finish it.
     
  47. Focuzed

    Focuzed

    Joined:
    Jul 21, 2013
    Posts:
    16
    Thats what I've come across. I don't like the 30 sec videos and the 1:15 sec videos, I dont' understand why they didn't put them all together, but make 60 1 min videos. Its annoying as hell. But I don't know how dated they are. I mean 1.5 years old but I don't wanna waste my time if its not worth it.
     
  48. tra2002

    tra2002

    Joined:
    May 11, 2011
    Posts:
    142
    They are dated but still a very good base for beginners. The basic knowledge you gain from them is still used.
     
  49. Maklaud

    Maklaud

    Joined:
    Apr 2, 2013
    Posts:
    551
    Guys, don't even waste your time.

    After review of the Lab 3 videos and Lab 4 videos, and fully watched Lab 1 and Lab 2, I may tell you - don't do that! Just tens of hours (!) of worthless videos!

    I had a question here some posts ago (about sprites and colliders). Well, I could figure it out myself, without watching these videos but by making my own game. And look at the 4th post here - some people agree with me. Don't waste your time on such terrible tutorials, just start making your own simple game, learn the forum, ask questions. And believe me, you will learn a lot more and a lot quicker, that by watching these tutorials.
     
  50. Echo4

    Echo4

    Joined:
    Aug 8, 2013
    Posts:
    1
    Quick question I am on the 2D Mario project with latest unity 4.2 and managed to get the files working in it but missing the animation sprite sheet texture for fire Mario. I downloaded the project from the Walker Boys site and it is not in the zip file. The mat file is blank in unity and text not in texture folder. I tried all over the Internet to find the png sprite texture to place on the mat to no avail. Does anyone have the 2D project files that are complete and not missing files. Thanks in Advance