Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Space Shooter Tutorial Q&A [ARCHIVED]

Discussion in 'Community Learning & Teaching' started by Valdier, Jan 12, 2014.

Thread Status:
Not open for further replies.
  1. dwestcoasttwin

    dwestcoasttwin

    Joined:
    Feb 11, 2015
    Posts:
    2
    Is there a complete version of this tutorial? It does not go into the way enemy ships are added.
     
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Adding the enemies are "stretch goals" for the student to achieve.

    I may do a live session covering this, but there is no scheduled time to add these to the persistent lessons right now.

    There is a "Done" folder included with the project which you can dissect, if that helps, to see how we set up the enemies, additional asteroids and scrolling background.
     
  3. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    303
    I haven't re-read the entire thread, so I thought I'd put this here just in case it hasn't been mentioned before:
    When you have a collider and you want to edit it directly in the scene, like adjusting the radius and such from a capsule collider, you need to click the little button in the Collider component called "Edit Collider". Then the handles appear in the scene view to adjust the collider. The handles don't appear anymore when simply holding down the Shift key as stated in the video "Creating Hazards" (Around 2:41).
    I guess this changed when the change was included about the colliders.

    Have fun & Happy coding & Creating!
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Yes, this is a recent change in 4.5 or 4.6. It had been mentioned, but thanks for keeping it fresh!
     
  5. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    303
  6. mprogers123

    mprogers123

    Joined:
    Feb 15, 2015
    Posts:
    10
    I've really been impressed with the tutorial. I've found one issue, in section 5.7, with DestroyArea. After I've added it, it says to play the game and confirm it works. But in my case, the Player's OnTriggerEnter2D() at this point destroys anything (they haven't added the layer check yet), so the DestroyArea itself gets destroyed. Has anyone else discovered this, or did I miss a step somewhere?

    Again this was an awesome tutorial, thank you for taking all the time that it must've taken to write it!

    Michael
     
  7. mprogers123

    mprogers123

    Joined:
    Feb 15, 2015
    Posts:
    10
    Another small point ... in 5.3, in the section on Attach Colliders, it says to "Attach a Polygon Collider 2D to each Player Bullet". However, having done so I couldn't destroy the enemy, and then I looked at the illustration, and it shows adding them to the Bullets (i.e., the Player Bullet's children). So I think that line should read "Attach a Player Collider 2D to each Bullet".

    Michael
     
  8. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Morning Michael,

    This thread is related to the Space Shooter tutorial, found here that Adam done :)
    http://unity3d.com/learn/tutorials/projects/space-shooter

    Threw me at the start, but it took me a wee bit of searching, but are you working through the "Shooting Game" found on the Unity Japan Page?
    http://japan.unity3d.com/developer/document/tutorial/2d-shooting-game-en/

    Ill have to work through it myself, but I will drop a PM if i can find anything out for you.

    wont be today as it might take me a couple of days to get through it.

    DaZ
     
    Last edited: Feb 16, 2015
  9. mprogers123

    mprogers123

    Joined:
    Feb 15, 2015
    Posts:
    10
    Oops, I did a search on The Shooting Game, and ended up here instead :) Yes, I am indeed working through the latter, and getting stuck from time-to-time (as you can see). Any advice would be welcome!
     
  10. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    No worries lol

    ill have a worth through tonight, see what i can find out :)
     
  11. Ravaj

    Ravaj

    Joined:
    Feb 18, 2015
    Posts:
    1
    Great tutorial Adam, thanks a lot for detailed work and explaning every step, highlighting even all the minor and trivial stuff too ! Which is really helpful for non-native english talkers with average english, very easy to follow. I'm at Counting Points chapter and around 14th minute and there is that gameControllerObject thingy.. :) I've gotta get used to it I guess. Since I couldn't totally embrace the "how" & "why". I've got suggestion for that also, if you could just list what&why we have to reference/show/bound (or whatever it's called) this objects in straight order with the logic explained. It would help a lot for my case at least ! Thanks a lot for tuts !!
     
    Last edited: Feb 18, 2015
  12. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Oboshape! Great detective work. I was wondering for a moment about the 2D references.

    Thanks again!
     
  13. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    If you're still stuck, start a new thread and pm me the URL and I'll come take a look. Afaik there isn't an official thread on that project yet.
     
  14. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'm prepping for GDC right now, but I'll try to have so look as soon as possible.
     
    Ravaj likes this.
  15. Bashplank

    Bashplank

    Joined:
    Jan 7, 2015
    Posts:
    9
    I currently have these two scripts set up to control the spaceship's movement and firing. The problem is that I cannot drag on the touch pad and shoot at the same time. I have to move, stop, then shoot. Any help would be greatly appreciated.


    -----A further problem has occurred when I tried building the game. The touch movement controls do not work, but only the firing.------

    Movement :

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using UnityEngine.EventSystems;
    4. using System.Collections;
    5.  
    6. public class SimpleTouchPad : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler {
    7.  
    8.     public float smoothing;
    9.  
    10.     private Vector2 origin;
    11.     private Vector2 direction;
    12.     private Vector2 smoothDirection;
    13.     private bool touched;
    14.     private int pointerID;
    15.  
    16.     void Awake () {
    17.         direction = Vector2.zero;
    18.         touched = false;
    19.     }
    20.  
    21.     public void OnPointerDown (PointerEventData data) {
    22.         if (!touched) {
    23.             touched = true;
    24.             pointerID = data.pointerId;
    25.             origin = data.position;
    26.         }
    27.     }
    28.  
    29.     public void OnDrag (PointerEventData data) {
    30.         if (data.pointerId == pointerID) {
    31.             Vector2 currentPosition = data.position;
    32.             Vector2 directionRaw = currentPosition - origin;
    33.             direction = directionRaw.normalized;
    34.         }
    35.     }
    36.  
    37.     public void OnPointerUp (PointerEventData data) {
    38.         if (data.pointerId == pointerID) {
    39.             direction = Vector3.zero;
    40.             touched = false;
    41.         }
    42.     }
    43.  
    44.     public Vector2 GetDirection () {
    45.         smoothDirection = Vector2.MoveTowards (smoothDirection, direction, smoothing);
    46.         return smoothDirection;
    47.     }
    48. }
    Firing:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using UnityEngine.EventSystems;
    4. using System.Collections;
    5.  
    6. public class SimpleTouchAreaButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler {
    7.    
    8.     private bool touched;
    9.     private int pointerID;
    10.     private bool canFire;
    11.    
    12.     void Awake () {
    13.         touched = false;
    14.     }
    15.    
    16.     public void OnPointerDown (PointerEventData data) {
    17.         if (!touched) {
    18.             touched = true;
    19.             pointerID = data.pointerId;
    20.             canFire = true;
    21.         }
    22.     }
    23.    
    24.     public void OnPointerUp (PointerEventData data) {
    25.         if (data.pointerId == pointerID) {
    26.             canFire = false;
    27.             touched = false;
    28.         }
    29.     }
    30.  
    31.     public bool CanFire () {
    32.         return canFire;
    33.     }
    34.  
    35. }
     
    Last edited: Feb 18, 2015
  16. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Quickly, as I don't have time to read thru the code:

    Is this the exact same code as copied from the samples on the archive page?
    I was going to ask if this is a problem only on the remote, but works in the build, but it sounds like your build isn't working.

    It works on my iPad air. I need to deploy it to a test android device to prove it.

    Can you double check your details, make sure the code is clean and exact and try building again.

    If this doesn't work, can you provide some additional details, such as device type and OS?
     
  17. Bashplank

    Bashplank

    Joined:
    Jan 7, 2015
    Posts:
    9
    The code is exact from the live training session (SimpleTouchPad is under Movement and SimpleTouchAreaButton is under Firing).

    I have a Nexus 7 (1st generation) running on the latest android update. (Lollipop).

    I forgot to add that moving the ship to the right on the y axis and firing at the same time does work, however moving left on the y axis or up/down on the z axis and firing at the same time makes the ship move to the right and fire. (I can't move right and fire at the same time because the ship automatically switches to move left when I put my finger down on the SimpleTouchAreaButton (i.e the firing control)). This problem occurs when using the Unity Remote 4 and playing the game in the editor.

    When building the game for android (I tried again now) and running on the Nexus 7 the movement controls do not function at all, whereas the firing does.
     
  18. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Humph!

    There may be an issue with Unity Remote 4 and the new UI. I'm looking into that... This would explain why things are dicey when testing in the editor.

    Now, why there is an issue with your Nexus 7, I don't know.

    This weekend, I'll try to deploy to my Galaxy Note and see if there are any issues, but, I can confirm that the code from the class works as expected on an iPad Air.

    Do you have any other devices to test with, just in case?
     
  19. Bashplank

    Bashplank

    Joined:
    Jan 7, 2015
    Posts:
    9
    No other devices, thanks for taking the time to test.
     
  20. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you just double check and make sure the two UI panels don't overlap in any way so they could be blocking input? And that there are no other UI elements that could be blocking the panels with the scripts.

    Also, by default, the event system should have two input modules, including touch input. Can you make sure they are both present?
     
  21. Bashplank

    Bashplank

    Joined:
    Jan 7, 2015
    Posts:
    9
    Hey Adam....

    I dun goofed. One fine mental lapse. I had accidentally un-ticked "Send Navigation Events" in the EventSystem. Game controls work as they should when building on the Nexus 7 now. The problem when playing in the editor with the Unity Remote 4 persists, but I'm sure that can be fixed.
    Terribly sorry for all the inconvenience. Thanks for your patience. Loving that beard too.
     
  22. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Hey - no! No problem at all! It's always fun in the mosh-pit of bug hunting. Glad we opened the correct component!

    Ya - there def. seems to be an issue with Remote 4... but so many people are busy coming up to GDC.
     
  23. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
    http://unity3d.com/learn/tutorials/projects/space-shooter/ending-the-game

    I did everything, but before i could actually completer any tests (as I am in Unity Free 4.6.2) so some mid way tests simply were impossible) when i finished the project, the asteroids go to the Z-axis direction Away from target. Second when they are hit, there is no sound explosion. My ship goes This way. ------>. In Scene test, Asteroid goes <----This way, as its suppose to. In Game when attacked to game controller, Ship goes ----->. Asteroids also go ----->. They move away from me not at me.

    Yet in the Scene window the asteroid model does when placed in scene and released will fly at the ship as it is suppose to and when shot explodes with sound. But again, if it does hit the ship the ship does not blow up but does take the impact. I went back in several times, checked the triggers, checked the rigid bodies, the colliders, the sound attachments, all the things in the scene.

    I went back to the DONE_ scripts and cross referenced every line of code and this is all in c#. Ship movement is fine. Firing and making the shot noise is fine. Dragging the pre-fabs in and releasing work fine. I even managed to get around the fact the GUIText has to be made first in a GameObject and works on the display. But enemy targets do not come at the ship, but rather move away on the z axis.

    I tried to just relocate the ship and more or less move the GUI to compensate and the results were...frankly bad. How do I get the asteroids to do what they do in the scene in game play mode? Its tiring and i spent a couple weeks trying to think up some solutions and stuck.
     
  24. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Hi there, just thought id drop a wee thought or two.

    out of curiosity, you said at the start you could not test until you completed the tutorial, was there any specific reason why you were you unable to test the scene as you work along with the video? I am also using this version, there is nothing that I am aware of within this series that cannot be done with the free indie version (4.6+). apologies if i've picked you up wrong there.

    first off, are you getting any errors in the console window when you play the game? especially in the areas where things arent doing what they should? ie explosions, SFX etc.

    for the asteroid movement, ensure that the prefab that you are using for the asteroid has the mover script attached and that the speed is -5 within the inspector window as shown in video.
    so when you drag that prefab onto scene in playmode, just confirm that it does indeed move downwards towards the player.
    so with you confirming that you have a prefab that works, ensure it is that same prefab that you have dragged and assigned to the hazard slot in the game controller.
    the movement of the asteroid is all self contained within the asteroid prefab itself, so theres no other code that should be affecting its movement.

    Correct me if im reading it wrong, you are saying that the asteroid does collide with the player, and that when the collision occurs the player and asteroid vanish, but there is no player explosion shown.
    in this instance i would firstly check the case sensitivity of your tags, as "player" and "Player" are different.
    double check this in your destroyByContact script.

    have a look at that and see how you get on.
     
  25. Marolir

    Marolir

    Joined:
    Feb 20, 2015
    Posts:
    1
    Hi! I am new in the forum. I am working on this tutorial and when I run and throw my bold on the hierarchy my bolt is static. I do have a mover script with velocity = forward * speed as instructed. tkx,
     
  26. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Hi Marolir, have you set the speed of the mover script in the inspector to 20 when looking at the bolt prefab?

    (look at the bottom of this image, yours should just say 'mover' ignore the done part its just an example)

     
  27. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
    Yes you understood me right, that the process would not let me do any further testing reaching the point of the Game Controller. Second, what was occurring was that scripts such as setting up "hazard" menu etc, did not appear without the completed script. As such when there showed some "incomplete definitions" it throws back a message you cannot enter play mode till you correct the errors. So I pretty much skipped all the way to the end.

    Now the second interesting bug I literally just fixed after smacking my head a few times and using some new forms of profanity, lol, was that basically the Mover script attached to the same as the bolt shot was forcing the targets(asteroids), to go the same direction even with the -5 point. Sound I had to just trash and put my own in, probably from a download error somewhere as I have received a couple of those both times i re-downloaded the package. It seems to be an asset store problem. (its not blocked by firewalls, etc. Already encountered that and still getting an error about a week after it was working fine.)

    So I did a minor work around. I created a second c# of Mover, and changed it to Enemy_move. Then i set everything the same. Including the -5 so it would stop reading from the same direction of the shot. Now its working correctly.

    On this same note with this video the GUI setup is a bit dated now. What i did is create three sub- GameObjects so i could create the GUItext. So those minor tweeks seem to have worked. Although my bolts look like Twinkies, shots sound like farts, and i scrapped the ship for a skull wearing a top hat i put together a while back,m replacing asteroids with Road Cones. Music i just slapped on some of my own stuff as a single wav file containing several songs so i would not get a headache listening to the same short loop.

    [edit: fixed quote level]
     
    Last edited by a moderator: Feb 21, 2015
  28. jshrek

    jshrek

    Joined:
    Mar 30, 2013
    Posts:
    220
    @RFoster - Just been working thru the Space Shooter tutorial and am at step "Counting Points and Displaying the Score" and have had no issues at all so far with running/testing everything. I am using free 4.6.2 version of Unity.

    Whenever there is an error showing, that just means you typed something wrong in your script (spelling or syntax issue). Double check you have typed everything EXACTLY as they have it in the tutorial. If you scroll down under each video, the scripts used in that video are there so you can copy and paste them in if you need too.

    Same issue for your asteroids going the wrong way ... they work for me just fine, so you must have missed a step in the tutorial or typed something incorrectly. I had an issue where something was not working and it was because I had typed "void start" instead of "void Start" so a lot of this stuff is case sensitive.
     
  29. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
    Nope, I checked this over and over and its a bug. Just like the asset store issue. Also i copied the code direct and double checked even the font type. Believe me it has had an effect a couple of times. But one thing I was wondering is where is the Second part of this tutorial? And how do you use all three target objects? I certainly do not want to modify the "Hazard code.

    "More or less being able to have all three objects spawn in game as in Asteroid 1, wave 1, Asterroid2 wave 2, enemy ship wave 3, etc.
     
  30. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
    PS> In any case overall it is a good tutorial. Some i have gone over are just so all over the place you could not follow them if you were glued to them.
     
  31. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    @RFoster. good stuff that you got it working, least the mover script is small, so deleting and recreating it wouldnt be a hardship.
    I agree the guys have done a brill job putting these vids together.
     
  32. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Oboshape: thanks for pitching in!

    Marolir: Let us know if you're still having issues.

    RForster: I'm sorry if you're finding this tutorial frustrating. It does work, and it does work in both free and pro for all the recent versions of Unity 4. The only issue, currently, is that the GUIText GameObjects no longer have a short cut as of version 4.6, and need to be created the manual way.

    Be aware of a few things...

    When we're following along with the tutorial, we won't be able to test our game (unless we really know what we're doing) at any stage that is NOT indicated in the lessons. If we just want to test what we are doing at any time, at any time our scripts could be incomplete and will not compile. This is a fact of coding. Unlike an incomplete physical object, where we could just examine it to see how it's doing, incomplete scripts will often throw errors when compiling. If we don't understand the script and the language and the compilation process, we won't understand what the errors are, what they mean, nor whether they need to be fixed right now or whether we simply need to wait until we've reached the appropriate point in the tutorial to test...

    ... So... That says "be patient, follow the tutorial and test only at the points in lesson that testing is appropriate".

    Detail is important.

    These languages are CaSe SenSitiVe! So simple tipos, mispelings and inCorrect Capitalizashun can break a script and therefore the entire project. Worse, the script will compile and be a working functional script, but - like a mutant - won't be the friend we were expecting and may function, but not as expected. Imaging trying to make Jack Black and ending up with some odd Frankenstein version of him shambling around your project.

    Detail is important (2).

    There are two main places we need to look when we have problems with out project: The Script and The Scene. We may have a perfectly well written script, but if the implementation of the Script on the GameObject or the Values on the Component are incorrect, we will also fail to get the desired effect.

    So ... If we've checked our script is 100% correct or have copied an example script verbatim and we still have problems, we KNOW we've made a mistake in how we've implemented the script. Here we then need to check out GameObjects, Hierarchies, Transforms, Components... To make sure they are all correct.

    One example could be that the mover script is correct, the values on the component it creates on the game objects is correct, but the GameObject's transform is reversed 180*. Because the script and the component values move the game object relative to its transform... this will make the GameObject move in the opposite direction than we want in the game world.

    I can assure you that if you successfully follow every step as shown in the video series, you will get a working game in free or pro in any recent version of Unity 4.
     
  33. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
    Indeed. I just need to learn how to expand on this Shooter and make it more interesting. lol
     
  34. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    303
    Well, I've completed the tutorial. Besides the few points I ran into and managed to fix with the help of all of you, It was a breeze.

    I have completed this tutorial with the free version of Unity. In fact I think I even updated Unity somewhere halfway through the tutorial to Unity's latest free version. It all went smoothly which is great!

    Big kudos to everyone who helped and made the tutorial!

    I think I'll try a few other tutorials first before I expand this particular game. I've got a few things in mind but I think I'll need to learn a bit more before I can do what I'd like to do with this game :)

    Have fun & Happy coding everyone!
     
    OboShape likes this.
  35. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Ace!

    Glad you found it useful. Keep us apprised as things progress in your development.
     
  36. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
    So next question, how do I get a Unity Binary URL? I did not understand the posting process at the end of this tutorial, setting up a local host or any of that. You're suppose to be able to do that from your own computer in windows 7 pro for example in wwwroot, but I have found no "walk through tutorial" as it only tends to talk about making a hosted webpage which is NOT what i want to do.

    If you are going to add this to something like Face Book, it requires a Unity Binary URL. I downloaded the SDK for the FB but after reviewing the bits of information in the package, it does not have any setup tutorial or walk through for someone like myself who has no clue What the Flipper to do. The few i have located assume everyone is a moderate to advanced user or skip over key parts. Sorry but I and I am sure many others need better walk through options then that.

    So to make it simple, and so I do not need to get overloaded where do i get a Unity Binary URL and how to I apply it to this project? Walk-through will be needed that is current. I found many such posts are incompatible with the current Unity Engines or Facebook's current updated settings. They are all for 2013 or earlier and/or in Js.
     
    Last edited: Feb 23, 2015
  37. wopolusa

    wopolusa

    Joined:
    Feb 21, 2015
    Posts:
    2
    Thanks for the tutorial. While it's very step-by-step and handholding (which is necessary in a beginner) it's really impressive that you go the whole mile and encourage long-term improvement as opposed to just finishing the game as easily and quickly as possible. for example teaching people to use the ctrl + ' search, 'optimizing' with the lower-poly meshes and deleting spawned asteroids and shots. While it likely would have had no performance impact in space shooter game I learnt a lot about what to do in future, larger projects which these things would have an impact on.

    A really invaluable resource for any beginner.
     
  38. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Sadly, no... We don't gave a walk thru for deployment to all platforms. The deployment path shown in the tutorial is a simple drop box post. For most people, this works as a sharing solution and proof of concept for a very simple beginner tutorial.

    Facebook integration is beyond the scope of this beginner tutorial.

    I would suggest a forum search on the topic, as this is a known deployment path with understood solutions.

    If you want to suggest that we do a live session on the topic, please suggest it in the live training thread in this forum section.

    Fwiw: we do have a live session where we convert this project to Mobile, so we may be able to so something similar for other deployment paths.
     
  39. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Thank you very much for the feedback! We always appreciate it. I'm glad it proved helpful. Please try the other projects that we have on the site.
     
  40. dearTeacher

    dearTeacher

    Joined:
    Oct 11, 2012
    Posts:
    2
  41. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    303
    Hmmm... That's weird. I see the same as you do, unfortunately. Yesterday the projects were exactly as they were supposed to be.

    Similar set ups are in the other projects as well (Survival Shooter, Stealth and 2d Rogue). It hink a few things got mixed up. I hope it will be fixed soon, cause I had hoped to start the Survival Shooter today :)
     
  42. dearTeacher

    dearTeacher

    Joined:
    Oct 11, 2012
    Posts:
    2
    It's fixed! Thank you Unity!
     
  43. RFoster

    RFoster

    Joined:
    Feb 18, 2015
    Posts:
    10
     
  44. dwestcoasttwin

    dwestcoasttwin

    Joined:
    Feb 11, 2015
    Posts:
    2
    I looked at the "Done" folder.
    What was really weird is that although enemies were appearing when I ran the Done project, I could not find anywhere in the Done scripts that directly said they were Instantiating the enemies. Are the enemies treated as "hazards", if so could you point out where in the Done Scripts the Instantiation of enemies is handled?
     
  45. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This seemed to be some sort of webglitch that some people reported.
     
  46. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Enemies are just added as another possible hazard.

    Look at the way that the hazards to choose from are in a collection (list/array) and that in the instantiate loop, the code picks a random hazard from the list.
     
  47. MaxTitkov

    MaxTitkov

    Joined:
    Feb 28, 2015
    Posts:
    1
    Thank's for your comment! It was helpful for me
     
  48. jshrek

    jshrek

    Joined:
    Mar 30, 2013
    Posts:
    220
    In the space shooter tutorial you are looking down from above as far as gravity is concerned, so with gravity on the shots would be falling down and thru the background layer. And as they fall they would then not be on the same plane as the hazards anymore and therefore not collide with them, even though (from above) they look like they should be colliding.
     
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Yes, and with an orthographic camera there is no perspective to give you a clue that it's moving away from camera until it leaves the far clipping plane and disappears.
     
  50. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    303
    Hey all,

    I couldn't help myself and worked a bit further on the Space Shooter game. I've made a Start screen from where you can access the Credits and Help and from where you can Quit the game. Credits and Help are both in their own scene. I assume I could have done this differently with the new UI system, but so far I couldn't find a proper solution. Hence me creating seperate scenes for them. Can I do this in a more efficient way? And if so, how do I do that?

    One thing I'd also like to do is have a High Scores table in the game. I want it to store the scores in a top 10. I'd like the Table to be displayed when the game is finished (as in the player has been destroyed) and I'd like the high scores table being accessable from the startscreen. I don't want the high score on a server, but instead include it in the game itself. I assume I'll have to use PlayerPrefs, although I haven't yet quit figured out how to do this.
    How can I do this?

    The startscreen and the high scores table is something I'd really like to include. That way the game seems more finished to me. Of course I'm also going to add more hazards, but I'd like to have these basics functioning properly first.

    Thanks for the help!
     
Thread Status:
Not open for further replies.