Search Unity

Free Live Online Training from Unity Technologies

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Oct 11, 2013.

Thread Status:
Not open for further replies.
  1. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Ugh! I'll try to get to it today!
     
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    TBH, there are some issues with that particular episode. Frankly I would like to replace it. Maybe this is the time to do it? I'm putting it down on my list to think about…
     
  3. boylamn

    boylamn

    Joined:
    Jan 28, 2015
    Posts:
    19
    Hi Adam,
    I'm trying to apply what you did in your last live training, and everything seems to be OK except the enemy ship which does not maneuver.
    Here's my Maneuver Script:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class EvasiveManeuver : MonoBehaviour {
    5.  
    6.  
    7.     public Boundary boundary;
    8.     public float dodge;
    9.     public float smoothing;
    10.     public float tilt;
    11.     public Vector2 startWait;
    12.     public Vector2 maneuvreWait;
    13.     public Vector2 maneuvreTime;
    14.    
    15.  
    16.     //private Rigidbody rb;
    17.     private float currentSpeed;
    18.     private float targetManeuvre;
    19.  
    20.     void Start () {
    21.  
    22.        // rb = GetComponent<Rigidbody>();
    23.         currentSpeed = rigidbody.velocity.z;
    24.         StartCoroutine(Evade());
    25.  
    26.     }
    27.  
    28.     IEnumerator Evade()
    29.     {
    30.         yield return new WaitForSeconds(Random.Range(startWait.x, startWait.y));
    31.  
    32.         while (true)
    33.         {
    34.             targetManeuvre = Random.Range(1, dodge) * -Mathf.Sign (transform.position.x);
    35.             yield return new WaitForSeconds(Random.Range(maneuvreTime.x, maneuvreTime.y));
    36.             targetManeuvre = 0;
    37.             yield return new WaitForSeconds(Random.Range(maneuvreWait.x, maneuvreWait.y));
    38.  
    39.         }
    40.     }
    41.  
    42.     void fixedUpdate()
    43.     {
    44.         float newManeuvre = Mathf.MoveTowards(rigidbody.velocity.x, targetManeuvre, smoothing * Time.deltaTime);
    45.         rigidbody.velocity = new Vector3(newManeuvre, 0.0f, currentSpeed);
    46.         rigidbody.position = new Vector3
    47.             (
    48.                 Mathf.Clamp(rigidbody.position.x, boundary.xMin, boundary.xMax),
    49.                 0.0f,
    50.                 Mathf.Clamp(rigidbody.position.z, boundary.zMin, boundary.zMax)
    51.             );
    52.         rigidbody.rotation = Quaternion.Euler(0.0f, 0.0f, rigidbody.velocity.x * -tilt);
    53.     }
    54. }
    55.  
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    fixedUpdate needs to be FixedUpdate with a capital "F"!
     
  5. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I meant next Thursday... :-/ So busy. I've not even finished cutting Extending Space Shooter!
     
  6. boylamn

    boylamn

    Joined:
    Jan 28, 2015
    Posts:
    19
    OHHH :eek: I did pay attention to it.
    Thank you very much for your help.
     
  7. subitoit

    subitoit

    Joined:
    Oct 5, 2015
    Posts:
    1
    Where i can download tutorial list ?
     
  8. SAAARGE

    SAAARGE

    Joined:
    Oct 5, 2015
    Posts:
    2
    I was hoping you would do a training session on menus, particularly with animated buttons.
     
  9. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  10. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Do you have an example of what it is you'd like to see?
     
  11. brandc

    brandc

    Joined:
    Feb 23, 2015
    Posts:
    16
    Have the scripts for Basic 2D generation been uploaded?
     
  12. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    They will be uploaded with the Lesson when it's ready. They were posted to pastebin during the live session, but I don't have access to those URLs. Perhaps @Matthew Schell wrote them down, but either way, they'll be posted as soon as the session is uploaded.
     
  13. shahtajkhalid1

    shahtajkhalid1

    Joined:
    Oct 5, 2015
    Posts:
    1
    Hello, i have just started using unity few days before and for some practice i started following the Beginners Break-Out game tutorial from this website, but the problem is after adding bouncy material and scripting on the ball, my ball is not bouncing back from the wall, i'm copying the exact tutorial and the code is same but it's not working with me while it runs perfectly on the video!

    I'm badly stuck here and really need help!
     
  14. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'm not familiar with this tutorial. Perhaps @Matthew Schell knows more?
     
  15. brandc

    brandc

    Joined:
    Feb 23, 2015
    Posts:
    16
    Thanks, I managed to find Room and BoardCreator on pastern but not the other two files (IntRange and Corridor). Here are links if anyone else can't wait like me =P

    If @Matthew Schell could paste the other two that would be great as the search doesn't seem to be listing them.

    http://pastebin.com/zvyWf1bN#
    http://pastebin.com/JF1GP3af
     
  16. Matthew-Schell

    Matthew-Schell

    Joined:
    Oct 1, 2014
    Posts:
    238
    Here's the archive with all four scripts:

    http://unity3d.com/learn/tutorials/modules/intermedia/live-training-archive/2d-dungeon-generation
     
  17. Matthew-Schell

    Matthew-Schell

    Joined:
    Oct 1, 2014
    Posts:
    238
    Can you give some more info? It's sticking to wall? Not bouncing enough? Make sure the walls have the bouncy material too. You want to make sure that the ball never loses any energy when it touches anything, otherwise it'll eventually slow down.
     
  18. Matthew-Schell

    Matthew-Schell

    Joined:
    Oct 1, 2014
    Posts:
    238
    see post above, they're up.
     
  19. Xeneth

    Xeneth

    Joined:
    Oct 7, 2015
    Posts:
    4
    Greetings!
    Just getting started with some of the basic tutorials and ran into a snag I'd like to wrap my head around before moving on to other lessons or creating something of my own... (noticed that singlet threads dedicated to this kind of question are usually routed here, but apologies if this is the wrong place!)

    The tutorial: CREATING A BREAKOUT GAME FOR BEGINNERS
    Double checking my scripts against the materials, I can't figure out why my game manager doesn't instantiate the bricksPrefab during Setup()... All I can do is check and recheck the scripts and objects against the tutorial, but nothing seems to be different so I'm stumped.

    This is Unity 5.2.1f1 on Win7(64bit) if that makes a difference, and I can definitely stick my "Bricks" prefab back into the scene hierarchy to see the game working as intended, but given the game manager centric focus of the lesson, I feel like it's important to understand why the managed instantiation doesn't work. My brute force solution of dropping bricks into the scene would not work if the intent was to have different levels with different brick layouts for example...
     
  20. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42
    hello there :)

    i made my own break ball game with very attractive graphics and play story...

    allmost completed 70% game(i.e. Android Game)...

    having problems with screen graphics...
    how can i make my game auto adujust according to the mobile screen size...


    plz help me out
     
  21. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42



    i think i got my answer i.e.
    camera.WorldToScreenPoint function...

    but i m little confused
    i uploaded to images one has 4:3 aspect ration and other is 16:9

    the game area is little bit expanded in 16:9(not playing field)

    but when we talk about candy crash or any candy crush type game or breakball game then perfectly looks same in all resulation...
    i m building advance BreakBall game which is going to be very unique but stucked in screen resulation...........
     

    Attached Files:

    • 43.png
      43.png
      File size:
      542.6 KB
      Views:
      883
    • 16 9.png
      16 9.png
      File size:
      697.4 KB
      Views:
      844
  22. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    @Matthew Schell is the best one for this question, but - have you checked your scripts against the published ones on the project page? I see that you've included the link, but have you checked against them - including spelling and capitalization?\

    If the scripts are correct, then it could be the way that they are set up in the scene: Do you have any errors in the console when you compile or play? (e.g.: "Null reference exception") If so, can you copy and paste the error here, or use a screenshot? Have you made sure that all the settings and references are correct? If there is a different value in the inspector of one of your components, compared to the project, it won't behave correctly.

    Post screen shots and / or code if you need help. If you are posting code, please use code tags!
     
  23. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    First off, when dealing with screen resolution and fitting... is knowing whether you're talking about technical issues (how to change the camera) or aesthetic or game-play issues (will this work for my game). The first thing I'd suggest you do is read this:
    http://theantranch.com/blog/some-issues-with-optimizing-your-game-to-all-resolutions/
     
  24. Xeneth

    Xeneth

    Joined:
    Oct 7, 2015
    Posts:
    4
    I had triple checked everything and was QUITE baffled... Just realized that somehow my Game Manager object itself wasn't sitting at 0, 0, 0 any more! Everything was working, the block positions were just behind way the camera centered on the object the instantiating scripts were in, nice. Out of curiosity, is that kind of positional issue common given Unity's apparent game object oriented focus? I'm still very new to this engine, so I got thrown by the spacial position of an invisible script handler causing confusion.

    The only issue I seem to be having with the tutorial now is the one directional light used to illuminate the scene going away once the victory or defeat is triggered. Is there an easy way to ensure lighting persists in a scene across re-instantiations?
     
  25. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The position of the game manager should be irrelevant. If the game manager contains only the game manager script ( or GameController, if I remember correctly) its transform, and therefore its position, rotation and scale, are never used and should have not influence. As a GameObject, then transform component is required, but in this case, does nothing.

    Can you give us more details regarding the light?,this is the second report of this and I can't see what's happening or how it's happening...
     
  26. Xeneth

    Xeneth

    Joined:
    Oct 7, 2015
    Posts:
    4
    In this particular case I think the position of the object housing the game management scripts only matters because of the way the instantiate command is cast...
    Code (csharp):
    1. public void Setup()
    2.     {
    3.         clonePaddle = Instantiate(paddle, transform.position, Quaternion.identity) as GameObject;
    4.         Instantiate(bricksPrefab, transform.position, Quaternion.identity);
    5.     }
    Now, I don't know enough about the guts of Unity to be able to tell you how this nesting differs exactly between the creation of the clonePaddle "token" for use elsewhere in the code vs. the raw instantiate on the bricksPrefab, but I can tell you the effects of this script; if the GameManager object is off somewhere random in space, (that was my mistake) bricksPrefab will instantiate wherever it happens to be, but the paddle will still show up where you'd expect in the play area! This is starting to make sense to me now and I think that regardless of where the GM is, I could have also fixed my issue by supplying 0.0.0 or something instead of transform.position.
    ...Come to think of it, It's probably the scripts in the paddle itself with their positional clamping that ensure it spawns in position compared to the bricks.

    I can try! So this project is lit by a single directional light that the tutorial either had me drop into the hierarchy near the very beginning, or it might have been some sort of default light that the scene came with (still very new to the editor, sorry!). Its rotation and scale were changed and then it was pretty much left alone for the whole tutorial:

    I'm not sure what makes this light different from the other components in the root of the hierarchy, though. It lights the scene just fine until the game is won or lost and then somehow either gets noticeably dimmer or is removed entirely when the scene is reset by the GM scripts after triggering the CheckGameOver states for winning or losing.
     
  27. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Ah, I was unaware of that code...

    This is simple, but - yes - does depend upon having the GameController at origin. The code transform.position means this GameObject's transform's position because of the lower-case transform line. It might be safer to place a separate GameObject at origin and give it the name spawnPoint, and add a public variable to the game public Transform spawnPoint; and associate the two, and then change the code to:
    Code (csharp):
    1. public void Setup()
    2.     {
    3.         clonePaddle = Instantiate(paddle, spawnPoint.position, Quaternion.identity) as GameObject;
    4.         Instantiate(bricksPrefab, spawnPoint.position, Quaternion.identity);
    5.     }
    ... this would protect your game against moving the GameController, which "traditionally" doesn't contain any location specific information. It would also be possible, in the context of this project, to "hard code" the spawn location with:
    Code (csharp):
    1. public void Setup()
    2.     {
    3.         clonePaddle = Instantiate(paddle, Vector3.zero, Quaternion.identity) as GameObject;
    4.         Instantiate(bricksPrefab, Vector3.zero, Quaternion.identity);
    5.     }
    ... but this isn't very flexible, as this sets the spawn position absolutely in code.
     
  28. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Perhaps @Matthew Schell can "shed some light" on this issue? As he created the project, I'm sure he can give it a run-through and see if he can reproduce this issue.
     
  29. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42
    hye i spent more than 15 days n bought new cell phone too ,(which have 480*800 pixels resolution) and have one also which have 720*1280 pixels resolution.....

    i donwloaded many games in both devices n saw many interesting thing some games like "Crossy road" which is developed in unity it has different stages n pattern in both devices...
    that mean i can code for different aspect ratiosbut in some games like "trucksform" which is also developed in unity looks same in both devices only size of the UI changes respectively....

    can u help what methord should i choose because i m a bigner which is best fro me....

    n one more thing i m not asking how to change camera according to screen i learned that n also about UI (how to change according to screen sizes)...
    it is simply i m asking can i make asets(code asets) to auto adjust according to screen size or i should code diffenet scripts for different resolution....



    Dont know i can properly explain my problem to u or not :-(
     
  30. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Well, some of these issues are not trivial, and these games studios may have spent a lot of high end developer time on this...

    Somethings are trivial - like the camera fitting the aspect ratio. This is automatic. You can also test out what the game will look like in the editor with the aspect ratio menu:
    bee4771c7c557e6716b90045b37b5b51.png

    You can also change the target device with the Player Settings panel.

    As this is beyond the scope of Live Training - I'd suggest that you post in the Android section and ask the people there, as they are experienced with making mobile games and how to deal with the variety of sizes, ratios and resolutions.
    http://forum.unity3d.com/forums/android-development.30/
     
  31. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    idurvesh likes this.
  32. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42

    hye adam i know that things....

    the editor with the aspect ratio menu:and change the target device with the Player Settings panel.

    but thnks 4 ur suggestions...

    :-(
     
  33. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The android gurus should be able to help you.
     
  34. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42

    My main Problem is that i cant find Any perfect "GURU" or "GURUS" :-(

    its really really very difficult for bigners like me who do self studies.....

    :-(
     
  35. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  36. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42
    hye there...

    i m trying to put mobo control in "2d Angry Bird Type Game"
    tried many time but always field first thing i m trying to add is when we drag bird before launch aiming arrow appear...
    (it appears OnDrag But not in the same direction where is our pointer is or The launching angel is) and i messed up every thing in converting the game....

    is there any tutorial availabe similar with my problem???
    i searching every where but not got any usefull info...

    i m uploading some picture which help u guys to understand what i m trying to do...

    in pictures u can see when we drag "Bird" a launching angel line appears n that what i m trying to do...
     

    Attached Files:

    • 2.jpg
      2.jpg
      File size:
      11.7 KB
      Views:
      845
    • 1.png
      1.png
      File size:
      65.7 KB
      Views:
      978
    • 3.png
      3.png
      File size:
      214.9 KB
      Views:
      1,021
  37. afonseca

    afonseca

    Joined:
    Feb 28, 2012
    Posts:
    80
    Hi, I have a question about the "Using the UI Tools" live training. Great presentation by the way!

    I downloaded the files and followed along until the last part where I added the options button to the bottom left of the screen. However, when I run the game even though the button draws, when I click on it my PausePanel does not come up. Attached is a screenshot of the setup in the editor.

    Screenshot 2015-10-17 18.46.52.png

    I tried setting a breakpoint in the PausePanel function to see if there was an issue there but it's never being hit. Any ideas?
     
  38. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42


    i m waitng for 3 days ....

    Why any body not replied yet?
     
  39. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Currently there are no tutorials converting Angry Birds to mobile, but if you discover some great insight, please let us know!
     
  40. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I try not too work too hard over the weekends... please be patient.
     
  41. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    WIth this amount of information, I'm unclear what the issue could be. The best I can say it carefully watch the video again and see what was missed. If you have any more detail you can give us, this might help.
     
  42. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42

    with apologies but can u tell me how i can add prededuction function(prededuct the throughing location of bird while draging) to angry bird in pc platform...
     
  43. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Well, I've not done it myself. If I were to try, my first thing would be to google unity angry birds prediction, and similar searches, as I assume it's a solved problem.

    If I wasn't happy with the returned answers, I'd turn to math and splines. The math of Velocity and Gravity is solved, so that's a Google search. For splines, I'd go to the "getting started with coding" thread here in teaching, follow the link to cat-like coding, and do his tutorial on splines.
     
  44. RajRajRaj

    RajRajRaj

    Joined:
    Aug 31, 2015
    Posts:
    42
    hye how i can fiex the velocity of asteroid in angry bird?

    that means when we strach band or asteroid less or more to thorugh the throughing speed always be same....
    i try to give it fixed velocity but i failed are u have an idea how to do that?????????
     
  45. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Like I said, I've not tried to do this, so I'd need to work it out. This I don't have time to do for you. And, tbh, this is beyond the scope of supporting thIs tutorial. I would suggest, as above, that you start by googling it and seeing how all the other people have solved this issue.
     
  46. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
  47. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Thanks Oboshape!
     
  48. DYV

    DYV

    Joined:
    Aug 10, 2015
    Posts:
    58
    Adam, could you explain how to use Jam Menu Template with multi-scene game?
    I added LoadLelevel buttons with LoadOnClick script using "Creating a Scene Selection Menu" tutorial but I can't hide menu and change music when new level is loaded. What would you suggest to do that one could use this menu with multi-scene game? Thanx
     
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    That might be a better question for @Matthew Schell as it's his project.
     
  50. DYV

    DYV

    Joined:
    Aug 10, 2015
    Posts:
    58
    thank you for the link
     
Thread Status:
Not open for further replies.