Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity 3 Video Training Course (FREE) - Walker Boys

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

  1. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
  2. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    Anyone can help me here ? :p
     
  3. ChrisAllen

    ChrisAllen

    Joined:
    Feb 24, 2012
    Posts:
    16
    if i remember from when i did it i did the following

    I set a variable called socketNumber which = 1 at the game start

    when the pickup is collected changed the socketNumber var to 2

    then when space is pressed to shoot just do an if statement to check what value socket number is at

    if socketNumber == 1 shoot from the first socket

    if socketNumber == 2, shoot from the second socket

    or you can do a switch statement on socketNumber if you know how they work

    hope this helps
     
  4. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20

    I've done it! Thank you so much!!!

    i don't know why i didn't thought about that ! i was getting crazy already lol

    Thanks again my friend ;)
     
  5. Android Matt

    Android Matt

    Joined:
    May 24, 2012
    Posts:
    61
    Where can I get the audio files for the projects? I'm on Lab 1 and no source is given...

    Thanks
     
  6. ChrisAllen

    ChrisAllen

    Joined:
    Feb 24, 2012
    Posts:
    16
    I think you just need to find somewhere to download some sounds from

    just have a look round on the net, there's loads of free game sounds available

    and if not download sfxr http://www.drpetter.se/project_sfxr.html and create your own (it's used in the next project as well)

    hope that helps
     
  7. weeseanator

    weeseanator

    Joined:
    Jul 20, 2012
    Posts:
    1
    I'm new to all this and seeking help with my setup of IDE.

    I have watched all the series 1 and 2 videos. When I did the java scripting videos I happened to already have notepad++ and used it instead of MonoDevelop.
    I wanna keep things the same as the videos and one I feel more comfortable with all the programs, then I will branch out and try the other programs.

    Now my problem is when setting up Unity Develop I am unsure if I am setting it up correctly(I don't think I am). Is Unity Develop the same as notepad++ with more bells and whistles? I am not even sure if im stating my problem well enough because I am so lost with Mono Develop, Unity Develop, and notepad++.
     
  8. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    I'm new as well using Unity, so far I've been using MonoDevelop and never had problems so far. I think you should use the one you're most confortable with.

    If you really want to use notepad ++ this link should help you :

    http://unifycommunity.com/wiki/index.php?title=Using_Notepad_Plus_Plus_as_a_script_editor

    It has all the steps to setup your notepad++ to use with unity :)
     
  9. Android Matt

    Android Matt

    Joined:
    May 24, 2012
    Posts:
    61
    Thanks!
     
  10. scr33ner

    scr33ner

    Joined:
    May 15, 2012
    Posts:
    188
    Hi guys,

    Thanks for the tutorials been very helpful with Getting into Unity!

    My question is about the player properties. I have my .js file verbatim like the video. I'm able to switch the textures, BUT, after the texture switches, I can't move the character. I went over it twice even went over part 4.2 to make sure I didn't miss anything but apparently I did.

    What am I missing that mario doesn't move/shoot when I call SetPlayerState()?

    Code (csharp):
    1. enum PlayerState
    2. {
    3.     /*index of player states*/
    4.     MarioDead = 0,
    5.     MarioSmall = 1,
    6.     MarioLarge = 2,
    7.     MarioFire = 3
    8. }
    9.  
    10. var playerState = PlayerState.MarioSmall; /*set the display state of player as small in inspector*/
    11.  
    12. var lives : int = 3;
    13. var key   : int = 0;
    14. var coins : int = 0;
    15.  
    16. var projectileFire : GameObject;
    17.  
    18. var projectileSocketRight : Transform; //shoot facing right
    19. var projectileSocketLeft  : Transform; //shoot facing left
    20. var materialMarioStandard : Material;
    21. var materialMarioFire     : Material;
    22.  
    23. var changeMario : boolean = false;
    24. var hasFire     : boolean = false;
    25.  
    26. private var coinLife : int = 20;
    27. private var canShoot : boolean = false;
    28.  
    29. function Update()
    30. {
    31.     var playerControls = GetComponent("playerControls");
    32.    
    33.     if(changeMario)
    34.     /*checks to make sure this only gets called when necessary*/
    35.     {
    36.         SetPlayerState();
    37.     }
    38.     if(canShoot)
    39.     {
    40.         var clone;
    41.         if(Input.GetButtonDown("Fire1")  projectileFire  playerControls.moveDirection == 0)
    42.         {
    43.             clone = Instantiate(projectileFire, projectileSocketLeft.transform.position, transform.rotation);
    44.             clone.rigidBody.AddForce(-90, 0 ,0);
    45.         }
    46.         if(Input.GetButtonDown("Fire1")  projectileFire  playerControls.moveDirection == 1)
    47.         {
    48.             clone = Instantiate(projectileFire, projectileSocketRight.transform.position, transform.rotation);
    49.             clone.rigidBody.AddForce(90, 0 ,0);
    50.         }
    51.     }
    52.     else
    53.     return null;
    54. }
    55.  
    56. function AddKeys(numKey : int)
    57. {
    58.     key += numKey;
    59. }
    60.  
    61. function AddCoin(numCoin : int)
    62. {
    63.     coins += numCoin;
    64. }
    65.  
    66. function SetPlayerState()
    67. {
    68.     var playerControls = GetComponent("playerControls");
    69.     var charController = GetComponent(CharacterController);
    70.    
    71.     /*best way to call up eunmeration is thru switch*/
    72.     switch(playerState)
    73.     {
    74.         case PlayerState.MarioSmall :
    75.         print("small");
    76.         playerControls.gravity = 0.0;
    77.         transform.Translate(0, 0.1, 0);
    78.         transform.localScale = Vector3(1.0, 0.75, 1.0);
    79.         charController.height = 0.45;
    80.         transform.renderer.material = materialMarioStandard;
    81.         playerControls.gravity = 20.0;
    82.         canShoot = false;
    83.         changeMario = false;
    84.         break;
    85.        
    86.         case PlayerState.MarioLarge :
    87.         print("large");
    88.         playerControls.gravity = 0.0;
    89.         transform.Translate(0, 0.1, 0);
    90.         transform.localScale = Vector3(1.0, 1.0, 1.0);
    91.         charController.height = 0.5;
    92.         transform.renderer.material = materialMarioStandard;
    93.         playerControls.gravity = 20.0;
    94.         canShoot = false;
    95.         changeMario = false;
    96.         break;
    97.        
    98.         case PlayerState.MarioFire :
    99.         print("fire");
    100.         playerControls.gravity = 0.0;
    101.         transform.Translate(0, 0.1, 0);
    102.         charController.height = 0.5;
    103.         transform.localScale = Vector3(1.0, 1.0, 1.0);
    104.         transform.renderer.material = materialMarioFire;
    105.         playerControls.gravity = 20.0;
    106.         canShoot = true;
    107.         changeMario = false;
    108.         break;
    109.        
    110.         case PlayerState.MarioDead :
    111.         print("dead");
    112.         Destroy(gameObject);
    113.         changeMario = false;
    114.         break;
    115.        
    116.     }
    117.    
    118. }
    119.  
    120. @script AddComponentMenu("WalkerBoys/Actor/PlayerPropertiesScript")// asign this script to menu
    Thanks in advance...
    scr33ner
     
    Last edited: Jul 22, 2012
  11. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    Hi guys, I finally finished my Lab 2 ! but the problem is i can't get the game running on my blog. the Unity player gives me this error :
    "Failed to download data file"

    Anyone here had this error before?
    can you guys try to see if you can access the project through my dropbox at the following link:

    https://www.dropbox.com/sh/4985qukaqdhxvvj/R2f30nL6G5
     
    Last edited: Jul 23, 2012
  12. ChrisAllen

    ChrisAllen

    Joined:
    Feb 24, 2012
    Posts:
    16
    I usually get that error if i've made a mistake with the filename
     
  13. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    Last edited: Jul 23, 2012
  14. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Okay - herer comes a (probably really) stupid question .... in the Unity API programming lessons there's the video about accessing components via hierarchy.
    To access the child the following code is used:

    Code (csharp):
    1. transform.Find("ChildName").GetComponent(AccessingGameObjects).someVariable = 25;
    I can completely accept that in order to access a child I have to use "trasnsform.Find()" but I somehow never really understood why transform (with a lowercase "t") is used here. So far I was under the impression that starting with transform - the transform component of an object is accessed.
    Now in this case we're accessing a variable instead of the transform. What am I understanding wrong here? :(
     
  15. Kale

    Kale

    Joined:
    Aug 25, 2011
    Posts:
    103
    @the_motionblur

    I believe (I'm not entirely sure) that transform is the instance of Transform. While Transform is a class.

    When every object is created, it's creates a new instance for just that object. While Transform is the class that the instance uses.

    @scr33ner,

    Not sure, but try taking your comments, and moving it up a line after the parenthesis and moving up the brackets. So it ends up like this.
    Code (csharp):
    1.  
    2.     if(changeMario) /*checks to make sure this only gets called when necessary*/
    3.     {
    4.         SetPlayerState();
    5.     }
    6.  
     
    Last edited: Jul 27, 2012
  16. Tym

    Tym

    Joined:
    Aug 3, 2011
    Posts:
    5
    Apologies if this too basic to post here, it's an early query from the video tutorials - "Classes with Functions Constructor"
    Code (csharp):
    1. function Update ()
    2. {
    3.     player124 = Person("crazyBot");
    4.     player175 = Person("horseMan");
    5.     player124.TeamUp(player175);
    6. }
    7.  
    8. class Person
    9. {
    10.     var name;
    11.     function Person(n:String)
    12.     {
    13.         name = n;
    14.     }
    15.     function TeamUp(p:Person)
    16.     {
    17.         print (name + " teamed up with " + p.name);
    18.     }
    19. }
    Like the tutorial, the output of the above (i.e. "crazyBot is teamed up with horseMan") isn't shown in the console window, however it isn't shown in the Editor Log either so I'm not sure if it worked. In fact, my Editor Log has nothing in it whatsoever from all the previous exercises so I'm wondering if the Log is working correctly. I can't seem to see any options for the Editors Log in the preference menus or similar, and the file itself (at the location user/appdata/local/unity/editor/editor.log ) isn't read-only or anything.
     
  17. WakeskaterX

    WakeskaterX

    Joined:
    Jul 29, 2012
    Posts:
    1
    Ok, I haven't worked on these tutorials since last October. New job, other projects, etc etc getting engaged lol, stuff has kept me busy.

    So I'm a little rusty and I just have a quick question, what all is needed on the Tools Lab? This was my submission last October: http://wakeskaterunity.blogspot.com/2011/10/unity-toolslab.html

    But it seems a bit lacking, I think I also need the animations part as well. I'm just getting back into all the code, so I figured I'd post it here to have someone take a look at it before I start on Lab 4.
     
  18. XIKO

    XIKO

    Joined:
    Dec 6, 2011
    Posts:
    10
    Hi Walker Boys, I have one problem on Project 5.
    Mario jump once ..and no more..everything works fine except the Jump function after press space once it won't jump again
    in other words it can only jump once.
    why?
    thx
     
  19. Kale

    Kale

    Joined:
    Aug 25, 2011
    Posts:
    103
    That sounds alike a coding problem. Without code to show what you did, you probably won't get a proper answer.
     
  20. M_Hybrid25

    M_Hybrid25

    Joined:
    Aug 3, 2012
    Posts:
    2
    Hello everyone! First, much respect for WB, the courses are a great resource for Unity newbies like myself :) .

    Now for the problem I've been having... I'm going through the Item Pickup Component tutorial for the 2D Mario Clone and I've taken the C# road when it comes to scripts. All was good until the ApplyPickup function which takes the "playerStatus" argument with its type being "playerProperties". In C#... I simply cannot find the right 'type' for playerStatus.

    I tried "public void ApplyPickup(playerProperties playerStatus)" , Unity says 'The type or namespace name `playerProperties' could not be found' . I said, Duhh, the script I have with the player properties is called csharp_playerProperties, tried that, and I get the names 'ApplyPickup', 'hudConnect' and 'playerState' do not exist in the current context. I'm thinking I'm missing some C#-specific syntax... any thoughts?

    Below is the 'troublesome' script.

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4.  
    5. public class csharp_itemPickup : MonoBehaviour
    6. {
    7.  
    8.     // Variables
    9.    
    10.         public enum PickupType
    11.         {
    12.             Grow        = 0,
    13.             Key         = 1,
    14.             Coin        = 2,
    15.             Fireball    = 3,
    16.             ExtraLife   = 4,
    17.             GameTime    = 5
    18.         }
    19.  
    20.         public PickupType pickupType = PickupType.Grow;
    21.         public int pickupValue = 1;
    22.         public Transform itemParticle;
    23.         public AudioClip soundItemPickup;
    24.         public float soundDelay = 0.0F;
    25.         public float soundRate = 0.0F;
    26.  
    27.         private GameObject playerGameObject;
    28.         private GameObject hudGameObject;
    29.         private bool extraLifeEnabled = false;
    30.  
    31.  
    32.         // Use this for initialization
    33.         void Start () {
    34.  
    35.             playerGameObject = GameObject.FindWithTag("Player");
    36.             hudGameObject = GameObject.FindWithTag("hud");
    37.  
    38.         }
    39.  
    40.  
    41.         void OnTriggerEnter(Collider other)
    42.         {
    43.  
    44.  
    45.             if (other.tag == "collisionBoxBody")
    46.             {
    47.                 csharp_playerProperties playerProp = playerGameObject.GetComponent<csharp_playerProperties>();
    48.  
    49.                 AppyPickup(playerProp);
    50.  
    51.                 renderer.enabled = false;
    52.                 if (itemParticle)
    53.                 {
    54.                     Instantiate(itemParticle, transform.position, transform.rotation);
    55.  
    56.                 }
    57.             }
    58.         }
    59.  
    60.  
    61.  
    62.         public void ApplyPickup(csharp_playerProperties playerStatus)
    63.         {
    64.             hudConnect = hudGameObject.GetComponent<csharp_hudController>();
    65.  
    66.  
    67.             switch (pickupType)
    68.             {
    69.                 case PickupType.Grow:
    70.                     if (playerStatus.playerState != playerState.MarioFire)
    71.                     {
    72.                         playerStatus.playerState = playerState.MarioLarge;
    73.                         playerStatus.changeMario = true;
    74.                     }
    75.                     break;
    76.                 case PickupType.Key:
    77.                     playerStatus.AddKeys(pickupValue);
    78.                     break;
    79.                 case PickupType.Coin:
    80.                     playerStatus.AddCoins(pickupValue);
    81.                     hudConnect.coin += pickupValue;
    82.                     break;
    83.                 case PickupType.Fireball:
    84.                     playerStatus.playerState = playerState.MarioFire;
    85.                     playerStatus.hasFire = true;
    86.                     playerStatus.changeMario = true;
    87.                     break;
    88.                 case PickupType.ExtraLife:
    89.                     extraLifeEnabled = true;
    90.                     break;
    91.                 case PickupType.GameTime:
    92.                     // playerStatus.AddTime = pickupValue;
    93.                     break;
    94.  
    95.             }
    96.      
    97.  
    98.         }
    99.    
    100.    
    101.  
    102.         void PlaySound(AudioClip soundName, float soundDelay)
    103.         {
    104.             if (!audio.isPlaying  Time.time > soundRate)              
    105.             {
    106.                 soundRate = Time.time + soundDelay;
    107.                 audio.clip = soundName;
    108.                 audio.Play();
    109.  
    110.             }
    111.  
    112.         }
    113.  
    114.  
    115.     }
     
  21. Kale

    Kale

    Joined:
    Aug 25, 2011
    Posts:
    103
    What's the exact error?

    Usually gives a line that is calling, for the error to happen.
     
  22. M_Hybrid25

    M_Hybrid25

    Joined:
    Aug 3, 2012
    Posts:
    2
    Hi Kale,

    with the code above Unity displays a total of six errors, all "The name X does not exist in the current context". X being 'AppyPickup' (once, for the line "AppyPickup(playerProp);"), 'hudController' (twice) and 'playerState' (three times). (This all pretty much ruined Friday :( )
     
  23. DTR94

    DTR94

    Joined:
    Aug 4, 2012
    Posts:
    1
    Hi everyone, I need some help in scripting, on the firt lab project. I'm stuck where we need to do an explosion when we click on an object.

    One of my solution was to drop the prefabExplosion as a child into prefabEnnemy and using in scriptEnnemy -> GetComponentInChildre(ParticleSystem) and followed by the method Play(); But this solution have big flaw...I need to put my prefabExplosion in every different prefabEnnemy that's not cool -_-'.

    I would like to know if someone succeed to use the new particle system (Shuriken) and use it trought the scriptEnnemy only and how ?

    PS :I read in forums that Instantiate was the wrong way to do with the new system.
    PS2 : Sry for my english level XD

    Thanks =)
     
    Last edited: Aug 4, 2012
  24. Kale

    Kale

    Joined:
    Aug 25, 2011
    Posts:
    103
    Ah, okay M_Hybrid. I think I got it. Instead of

    Code (csharp):
    1.  
    2. var hudConnect = hudGameObject.GetComponent<hudController>();
    3.  
    Use...
    Code (csharp):
    1.  
    2. var hudConnect = hudGameObject.GetComponent(hudController);
    3.  
    and change it for
    Code (csharp):
    1. csharp_playerProperties playerProp = playerGameObject.GetComponent<csharp_playerProperties>();
    as well.

    DTR94. I haven't used Shuriken so I have no idea what it's all about. But you shouldn't have to make it a child of prefabEnemy, but just create an instance of explosion at the transform of prefabEnemy.
     
  25. ciberxtrem

    ciberxtrem

    Joined:
    Jul 24, 2012
    Posts:
    5
  26. Kale

    Kale

    Joined:
    Aug 25, 2011
    Posts:
    103
    Wow ciberxtrem, that was pretty awesome. Nice idea to apply a theme to a rather bland and simple game.
     
  27. TakMarche

    TakMarche

    Joined:
    Jul 21, 2012
    Posts:
    36
  28. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    @ciberxtrem i don't know why but i can't see your project, it just keeps saying to me that i need to install unity webplayer (that i have already installed)

    @TakMarche very cool and nice project ! Very well elaborated ;)

    It makes me want to get back to my first project and change some stuff ;)
     
  29. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello again! Lab 3 is finally finished :)
    http://chudy.rootnode.net/blog/?p=4 (this web server is quite slow sometimes, please have patience)

    At least I can reach Lab 4 with understanding what's going on :) Thanks again for this great tutorial!
     
    Last edited: Aug 6, 2012
  30. Kale

    Kale

    Joined:
    Aug 25, 2011
    Posts:
    103
    I had that issue too. I eventually upgraded my Unity, and that got it working.
     
  31. Greeneggsnoham

    Greeneggsnoham

    Joined:
    Aug 6, 2012
    Posts:
    2
    Hey again,

    I have taken the project 4 and expanded on it for my own learning. The new version is called Super Montreal World (Montreal in French is pronounced somewhat like Moreo). It's based on some of the current events happening in Montreal and Quebec:
    - bridges are falling apart,
    - the roads are completely blocked with construction to repair said bridges,
    - the students have been demonstrating against a drastic tuition increase for 6 months now, walking around banging pots and pans, also causing traffic jams

    I redid most of the code to try to get the game to run a little smoother. I also created new sprites through making models in Blender, animating them, then creating sprite sheets. They're not very good, but I'm still learning those tools as well.

    You can find it here:

    http://dewieproductions.net76.net/project_four_plus/WebPlayer/WebPlayer.html
     
  32. TakMarche

    TakMarche

    Joined:
    Jul 21, 2012
    Posts:
    36
    @Brainvibe thanks that means a lot! It took awhile for me to finish but I might actually want to go back and go farther as well as maybe add a couple more levels.
     
  33. ciberxtrem

    ciberxtrem

    Joined:
    Jul 24, 2012
    Posts:
    5
    Thanks, I want also to improve my "art" skills, in fact I started making the background ( inspired in the Brainviblle game) and made a little theme from that to make it also a little more interesting from a game design perspective, xD

    As I saw in here I've downloaded this cab file, extracted and finally installed the exe inside it.
    http://webplayer.unity3d.com/download_webplayer-3.x/UnityWebPlayer.cab
    Your games are very well finished, the details make the difference and they usually takes lot of time.
     
  34. Android Matt

    Android Matt

    Joined:
    May 24, 2012
    Posts:
    61
    Here's my effort at Lab 1. Inspiration credit for space theme goes to Brainvibe! I spent a while seeing how much I could do at this stage with my limited experience, I feel like it was worthwhile pushing it, but is now at a point where diminishing returns on my time make it sensible to move onto the next tutorial.

    Screenshots of the desktop version below, and the web-player version is here (unfortunately without some of the eye candy).
     
    Last edited: Oct 11, 2012
  35. AeROLP

    AeROLP

    Joined:
    Jul 6, 2012
    Posts:
    1
    I don't know if i can post this here, if not i apologize please move.

    I'm having a hard time trying to figure out why, in labproj2, when i put the shield as a child of the player, it's collision are compromised and it doesn't responds anymore, when i detach it(forced from the hierarchy) it starts acting well.

    What could be?:confused:
     
  36. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    @ciberxtrem I finally had the pleasure to play your game! It was a problem with my browser Chrome (i don't know why), i used Safari and it worked well.
    Loved the concept and the work with the lights blinking they're awesome, very cool concept! =)

    @Android Matt You really did an excellent job, great art and the camera rotation was awesome! (never thought about that!)

    @TakMarche No need to thank me , we need the feedback, even if it's good or bad, that's what gives us motivation to continue our journey to game development =)

    Damn, i really need to go back to my first game after seeing these amazing projects :D but first i have to finish lab 3 ;P
     
  37. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
    Nice work! im looking forward to start Lab 4 but have to finish the lab 3 first. Cool game ;)
     
  38. TakMarche

    TakMarche

    Joined:
    Jul 21, 2012
    Posts:
    36
  39. Greeneggsnoham

    Greeneggsnoham

    Joined:
    Aug 6, 2012
    Posts:
    2
    Anyone else doing or finished Lab 5? I've run into a problem that I can't quite work out.

    The angleslide code doesn't quite work properly. There are two problems:

    1) If the player lands on a slide object, but doesn't press a movement direction, the character doesn't slide. He just sits there.

    2) If you jump while sliding your character is launched off the scene's plane while still in the sliding animation.
     
  40. Brainvibe

    Brainvibe

    Joined:
    Jun 3, 2012
    Posts:
    20
  41. b00b00KO

    b00b00KO

    Joined:
    Jul 10, 2012
    Posts:
    6
    hi guys;

    hope someone can help me figure why Unity keeps on crashing everytime i run this code. (clicking the Play button)
    i have followed video part 25 class inheritance - javascript introduction. in the video it works fine and this made it to the console.
    mine makes Unity close and crash without any warning.
    i'm under Mac os x using Unitron. should there be something i should be using instead like Monodevelop. because i noticed in the video series Javascript introduction, they changed the IDE used compare to previous videos.
    ???
    i also got no errors of any kind.

    Thanks in advance. (my code below)




    function Start () {

    }

    function Update ()
    {
    var lady = npcLady ("NPC Lady", false);
    lady.IsWalking();
    }

    class NonPlayerCharacter // base class for NPC
    {
    var npcName : String;
    var npcHasWeapon : boolean;

    function NonPlayerCharacter (n : String, weapon : boolean) // constructor setup
    {
    npcName = n;
    npcHasWeapon = weapon;
    }
    function Walking () // class function
    {
    Debug.Log (npcName + " is walking in circles.");
    }
    }

    class npcLady extends NonPlayerCharacter // inheritance
    {
    var simpleText : String;
    function npcLady (n : String, weapon : boolean) // constructor
    {
    super (n, weapon); // call the original constructor
    simpleText = "This Lady";
    }
    function IsWalking()
    {
    super.IsWalking(); // call the original function
    if (npcHasWeapon == true)
    {
    Debug.Log (npcName + " armed and dangerous. run!");
    }
    else
    {
    Debug.Log (npcName + " safe and not a threat.");
    }
    }

    }




    anyone? :(
     
    Last edited: Aug 17, 2012
  42. TakMarche

    TakMarche

    Joined:
    Jul 21, 2012
    Posts:
    36
    Need help on Lab 3. I got stuck trying to do the UV Offset Scale FPS. int index = Time.time * framesPerSecond isn't working for me because I have to change it to a float and the tutorial requires it to be an int for the sprite so I did, int index = (int)Time.time * framesPerSecond so it increase by 1 each time but it goes 1,1,1,1,2,2,2,2,3,3,3,3 etc... and my fps is going really slow and you can barely see the animation.

    -----------------------------------------------------------
    [Edit]
    Found a solution for anyone who may have the same problem. If you stuck on trying to get your fps to go 8 frames per seconds like in the video and it moving as slow as a turtle then all you have to do it this:

    public int framesPerSecond = 8;

    and the this for index

    int index = (int)(Time.time * (float)framePerSecond);
     
    Last edited: Aug 21, 2012
  43. simonsheng

    simonsheng

    Joined:
    Aug 25, 2012
    Posts:
    1
    Hi walker.
    I love your video so much, but I can't find your 19~29.Where are they?
    Simon
     
  44. mobilebase

    mobilebase

    Joined:
    Aug 27, 2012
    Posts:
    1
    Hi Walkerboys,

    Thank you for the great tutorial here. Absolutely fantastic!!

    I am up to Mario 2D Side Scroller: Video 7 - Tutorial 23 - 6 Gumba function move idle
    I know that the tutorial video show everything works well BUT it didn't quite work for me. I am using the latest Unity 3.5.5f3 (on Mac). For some reason, when I switch Gumba from moving left to right or vice versa, it jumped to a new position, it doesn't move from its last x position. For example when I move from left to right, its new position is much further to the right, and then when I change it to move left, it starts from much further to the left.
    Have spent a few hours debugging the code/properties, and can't find any issue (the code is exactly like the same with the tutorial). Like in the tutorial, I removed rigid body, and set character controller's properties with the same exact value like in the tutorial.

    Anyway, I played around and finally found how to fix this issue. Instead of using Update() function, I put all the codes inside FixedUpdate() function and it works. I have no idea why that fixed it. I guess when we use Character Controller we should start using FixedUpdate() instead of Update().

    Comments?Suggestions?

    PS
    Also found Unity bug with long texture name. When the texture name is too long, it doesn't work, have to rename to a shorter name to fix it. This happens on 'mario_fire_animation_sprite_sheet_outlined' and 'gumba_yoshi_animation_sprite_sheet'. Simply renamed them to 'mario_fire' and 'gumba_yoshi'. Strangely the long name works on new unity project but not within the tutorial project file.
     
  45. Sabi96

    Sabi96

    Joined:
    Aug 27, 2012
    Posts:
    3
    Excuse me, but is there any way i can download these videos to my pc? no matter of the size, HDD won't be a problem :D
     
  46. haico1992

    haico1992

    Joined:
    Aug 27, 2012
    Posts:
    4
    Same question , I tried to search this thread but for some reason i can's go to the answer post. Not sure if it me or this forum engine just wrong in some way
     
  47. Taytus

    Taytus

    Joined:
    Dec 29, 2008
    Posts:
    47
    Hi guys,

    Are the Unity Course JavaScript (Video 1 - 15) and the Unity Course JavaScript Continued (Videos 16 - 26) offline?

    Thanks.
     
  48. TakMarche

    TakMarche

    Joined:
    Jul 21, 2012
    Posts:
    36
  49. GameStar18

    GameStar18

    Joined:
    Aug 30, 2012
    Posts:
    5
    Hello and thank you Walker Boys for your wonderful tutorials! I have finished lab projects one and two and just got around to creating a website after following the tutorials. I am still getting used to how wordpress works and how to go about creating web pages since I have forgotten how it's done. I had to remove the background music on the title screen of my first game due to it not working on the webplayer otherwise so that's a bummer. Any feedback is appreciated.
    This is my website.

    I have checked out some of each of your lab projects, only ones I have completed at this point and I must say, wow you guys have done an amazing job! Keep up the great work guys! Did you guys create those ship models or did you find them somewhere? I had a hard time finding any so I just made my own little thing.
     
    Last edited: Aug 31, 2012
  50. Tym

    Tym

    Joined:
    Aug 3, 2011
    Posts:
    5
    I would like the same, but I believe the Walker boys did this intentionally so they can monitor usage.