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

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. Valdier

    Valdier

    Joined:
    Jan 8, 2014
    Posts:
    1
    There are several problems with this tutorial that were I not experienced in developing, lead to relative dead ends for new people.

    The engine component for the ship engines_player, does not render in the game or scene space until actually playing.

    In the Player Movement tutorial, the script fails several times throughout the tutorial leaving you to sit and wonder "what is wrong?".

    I realize you are referencing entities without values early on and correct it later, but nowhere in the tutorial does it actually ever explain that. You should really have one of your documentation people go back through this because it is a very bad starting point for new people coming to Unity, at least with the current build and tutorial set.
     
    Feelsickened and timoni like this.
  2. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
    Please give a link to the tutorial and maybe some script reference.
     
    AndyE8 likes this.
  3. MDragon

    MDragon

    Joined:
    Dec 26, 2013
    Posts:
    329
    Yeah, the link to the tutorial would be very helpful.

    Also, is it one of the old ones on the Assets store? Many of those are for past Unity versions and don't work as-is. However, I'd still love them to be updated or at last-

    Nevermind, you're talking about the latest, newest one here:
    http://unity3d.com/learn/tutorials/projects

    Here's to hopes that a Unity Staff member will get to it quickly! When I saw that today, I was pretty curious and wanted to follow it, although I already have a current project. :)
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The link to the tutorial is here:
    http://unity3d.com/learn/tutorials/projects/space-shooter

    This is a new project that was release just before Christmas.

    Valdier:

    Please see my replies in-line below:

    The "engines_player" is a particle system. These are very powerful and efficient systems for making visual effects in game engines, including Unity. You should familiarise yourself with particle systems as you move forward in your development to understand their strengths. One of the expected behaviours of a particle system is to not display in edit mode unless you are selecting/editing that particle system. This is partly for performance reasons, but mostly (imho) to keep the editing experience clean and distraction free.

    You will see a gizmo indicating the location of the particle system in the scene view unless you have turned off or reduced your gizmos.

    $Screen Shot 2014-01-13 at 10.25.50.png

    If you want to see the details of the engines particle system drill down through "engine_player" to the two particle systems that make up the player engine vfx: part_jet_core and part_jet_flare.

    $Screen Shot 2014-01-13 at 10.09.06.png

    If you select/edit the particle systems, the particle system will play in the scene view. When you have finished and deselected the particle system, or changed focus to a different GameObject, the editor will display the last frame of the particle effect in the editor:

    $Screen Shot 2014-01-13 at 10.10.17.png $Screen Shot 2014-01-13 at 10.10.01.png

    I'm sorry that your Player script was not working correctly. Let's try to find out "what is wrong"?!

    Are you sure you followed the steps accurately? Have you gone back to the beginning of that video and checked each step? The script should not intermittently fail. It should work, or, if there was an error in writing the script, it should fail in the console with a concrete error, which should point to where the error was made.

    Have you tried the "Done" scene? Does this fail for you? I have not been able to make the script fail. As the videos were recorded with the scripts as written, and the game did successfully compile and play during recording... the scripts should work as long as they were accurately written. If you need to, you can compare your final script to the "Done" scripts in the "Done" folder. This way you will be able to see your errors with a "side by side" with the complete script.

    $Screen Shot 2014-01-13 at 10.57.39.png

    One issue that you could be running into is saving your script before it is finished and returning to Unity. If you return to Unity before the script has reached a stable point and you have saved that script, you could have a script that will not compile and you will get errors in Unity. This, however, should give you error messages in the console. Make sure you complete each step before saving and returning to Unity. You can swap your focus to Unity at any time without issue if you don't save your script. It is the act of saving the script that will indicate to Unity that you are ready to recompile. Saving an incomplete script could lead to compile errors.

    Do you have any error messages that you can post that might help us find out where your project has gone off the rails? We'll try to get you back on track asap.

    I don't understand this comment at all, frankly. I go out of my way in this video series to reference the documentation directly from the script editor and explain not only the specific function we need, but the class it belongs to.

    Can you give any more information as to which video and the approximate time where you are confused and what is confusing you? This way I can either explain what's going on, fix any problem if it exists - or both if necessary.
     
    Westland and John3D like this.
  5. the_hit_girl

    the_hit_girl

    Joined:
    Jan 18, 2014
    Posts:
    1
    Adam,
    I am following your tutorial right now and it's very good. I am having an issue with the game hazard asteroids. When I test my scene after applying the gamecontroller script the asteroids fall diagonally instead of straight down. Any idea why this is?
     
  6. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The very first things I'd do (standard reply, I know) is to check the video again and/or compare it to the "done" scripts to make sure all the code is correct. Most likely there is a typo somewhere that's effecting the way the asteroids move. The asteroids move using physics forces and setting the Ridigbody.velocity so, the forces might be set with values in more than just the z axis? or they could be set in some other way that doesn't act one the asteroid along the global coordinates.

    If, after checking the script for typos, you still have aberrant behaviour, post your Asteroid controller code here and we'll go through it together.
     
  7. corlain

    corlain

    Joined:
    Jan 21, 2014
    Posts:
    2
    I have a kind of problem very strange, all work perfectly in unity. but when the game is done, made for webplayer, 0 errors, all perfect, the problem is when im going to play it at the web, movement controls dont work , fire shot yes.

    any help will be appreciated.

    sorry for my english.

    Thanks

    TL.DR: Amazing Tutorial
     
  8. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Fuss and Bother!

    It works for you in the editor but not the web-player... :(

    And I assume you've double checked the code against the "done" folder?

    Try building the "Done_Main" scene (or whatever it's really called...) and see if that works on the web. If it does, then check for differences between the two, if it doesn't, then ping me here again, and we'll work through it.
     
  9. corlain

    corlain

    Joined:
    Jan 21, 2014
    Posts:
    2
    Yeah with Done_main works fine, I dont understand why with my scene don't work, if I did all the path like the tutorial. Anyway thanks for help me and your answer Adam.
     
  10. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you post your code, corlain?

    You can always post it to a site like: pastebin.com and the save the page and paste the specific url to the script... this will save space.

    If you do paste the code here, make sure you use code tags: Using-code-tags-properly
     
  11. federicomazzini

    federicomazzini

    Joined:
    Feb 10, 2014
    Posts:
    2
    Hi ppl of the community!
    i also have a problem with this tutorial, mine is with this lesson called Creating Hazards:

    http://unity3d.com/learn/tutorials/projects/space-shooter/creating-hazards

    i did exactly as this tutorial says, even copypasted the code in every lesson but some things seems to have changed about how the unity classes used in this tutorial works since the time when this videos where made (maybe rigidbody.angularVelocity?).
    my asteroid not only spins but also moves freely around 3d space in a random direction, making the collision with the shots impossible, while the asteroid in the video spins in place.
    The code is the same since i copypasted it so here's the proyect in case youre wondering how i've followed the rest of the instructions:

    https://www.mediafire.com/?3z6bin0cviwytnp

    PS: english is not my native language so please forgive my gramatical, orthographic and such errors.
     
  12. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Federico:

    This is due to the way the collider is set on the Boundary in the scene.

    You have copied / written the scripts correctly, but other components are not correct.

    One way to test this is to run the "Done_Main" scene in Done / Done_Scenes. If this is working correctly, then you know that it is an issue with the way you have set up your scene. Another way is to drag one of the the "Done_Asteroids" from Done / Done_Prefabs into the scene and test. This also works correctly.

    What this boils down to is: You have both the Boundary object's collider and the Asteroid object's collider set as normal collision detecting physics colliders.

    If you watch the previous video ("Boundary") more closely, at about 1:45 - 1:55, the Boundary's collider is set to be a "Trigger" collider by selecting "Is Trigger".

    What's happening is, with both the Asteroid and the Boundary set as physics colliders, the Boundary and Asteroid are rejecting each other, as part of a physics based collision on the first frame of the game. As the Boundary object does not have a rigidbody, the Boundary cannot respond to physics forces, so it does not move, and the Asteroid is ejected from the Boundary, which is where it's getting the movement force from.

    To fix this issue, you need to set your Boundary's Box Collider "Is Trigger" property to "true" by enabling the check box.

    Optionally, you can also set your Asteroid Collider to "Is Trigger" as well, as it does not need to be a physics collider. Either way, it will receive the "OnTrigger...." messages from the Lazer Bolts as they are marked as "Is Trigger" as well.

    Hope this helps!

    Let me know if you run into any more issues.
     
  13. federicomazzini

    federicomazzini

    Joined:
    Feb 10, 2014
    Posts:
    2
    I set the Boundary collider to "Trigger" and that hit the nail. Thnx Adam !
     
  14. Punkiller182

    Punkiller182

    Joined:
    Feb 13, 2014
    Posts:
    2
    Hello, Adam!

    Maybe I'm asking this inside the wrong thread and I'm sorry if this is the case, but I'm having an issue with a simple game I'm developing using this tutorial:

    I created a shot like those in this tutorial and followed the "Shooting shots" part. The problem is that when I Instantiate the shot with the script it simply appears inside the hierarchy field but doesn't show on my game view, however when I drag the shot prefab to the "Shot Spawn" Object in the Hierarchy field it fires properly

    Any idea why this could be happening?

    Thanks in advance.
    This is a great tutorial by the way.
     
    Last edited: Feb 13, 2014
  15. Punkiller182

    Punkiller182

    Joined:
    Feb 13, 2014
    Posts:
    2
    Never mind, Adam. I figured it out. Somehow my prefab was bad scaled and I guess I was not able to see them on the little game view screen I use. Besides, doing this at 19 PM instead of 2 AM "may" have something to do with my concentration being better now. Haha.

    Anyway, to comment on the thread main theme, the tutorial seems perfect for me, even being new to Unity and gaming development.
     
  16. Premier2k

    Premier2k

    Joined:
    Feb 27, 2014
    Posts:
    5
    Hi,

    I'm new to Unity and really enjoying it at the moment!

    Unfortunately though, I'm having issues with the space shooter tutorial, I'm on the player movement chapter and it's just told me to go in and move the ship around. This is to show me that it's slow and eventually we increase the speed.
    But, I can't seem to move the ship? I've tried pressing different keys but nothing seems to work?

    What am I missing here?

    Thanks,
    Premier2k
     
  17. Premier2k

    Premier2k

    Joined:
    Feb 27, 2014
    Posts:
    5
    Never mind, I figured it out. I had the speed set to 0. Doh!
     
  18. Anodos

    Anodos

    Joined:
    Feb 28, 2014
    Posts:
    1

    Hi there , I'm doing the space shooter tutorial and I'm stuck at the scriting segment. I keep getting this meassage :Assets/scripts/StarfighterController.cs(14,1): error CS8025: Parsing error . I've tried copy paste with the done code to make it match with the one in the video and nothing changes. lost please elp. :D
     
  19. DJBUCKWILDE

    DJBUCKWILDE

    Joined:
    Mar 3, 2014
    Posts:
    2
    HI,

    Just working through this and am stuck at the stage where you drag your asteroid prefab to the game controller script to associate the asteroid as a hazard.

    Any thoughts??

    p.s. I'm pretty much copying and pasting the scripts from the boxes below the tutorial videos each time.
     
  20. DJBUCKWILDE

    DJBUCKWILDE

    Joined:
    Mar 3, 2014
    Posts:
    2
    Forget that - just made a new game controller script called gamecontroller2 and started again...
     
  21. SeriousTangents

    SeriousTangents

    Joined:
    Nov 1, 2013
    Posts:
    12
    I decided to spend a weekend and go through this tutorial package and see what it had to offer. I am glad that I did.

    The tutorial itself was well paced and explained what the code is doing quite well. The minor issues that I had with code generally dealt with me missing a minor step (such as turning the Capsule Collider off for the asteroids...) but were resolved easily before I moved onto the next section.

    This tutorial, as it stands, is called Chapter 1 and there obviously are some things that are missing from the 'published final project' than what I see in the provided "Done Demo" game. Such as a scrolling background, enemy ships, etc.

    I'm looking forward to seeing the next chapter/installment of this tutorial series to be posted soon. I'm picking apart the scripts in the Done folder to see how they work, but I tend to pick things up a little faster with the video tutorials for some reason. Any word on when we might see Chapter 2?

    Regardless, this project helped me understand C# better. Having done so much coding in Javascript I found the general layout for C# to be somewhat... alien. This project helped overcome that hurdle and I am looking forward to more from the Unity Team.

    Joseph.
     
  22. givecake

    givecake

    Joined:
    Mar 28, 2013
    Posts:
    14
    Just putting this here for anyone else that might get stuck. I'm using Unity 4.3.2f and had an issue or two during the 'Shooting Shots' part of the tutorial.

    Where it says in the script:
    I was getting errors about both position and rotation, and subsequent errors relating to the same. 4 in total.

    If you simply connect these to transform, it works fine. If you're having this issue, change to;
    Thanks for a great tutorial!
    :)
     
  23. andylowe99

    andylowe99

    Joined:
    Mar 13, 2014
    Posts:
    1
    Hi, I'm having a problem with the Space Shooter tutorial and would be grateful for some help...

    In Chapter 10 ('Creating Hazards'), there is a moment when the asteroid disappears and the tutorial goes on to explain about tagging.

    Thing is, my asteroid doesn't disappear - and if I go on to follow the tagging section, there is no collision detection between the ship/shot and asteroid. They just go through each other.

    I'm thinking it might be something to do with the boundary settings?

    Could anyone suggest something? Thanks...

    --Code I'm using for DestroyByContact:
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class DestroyByContact : MonoBehaviour {
    5.  
    6.     void OnTriggerEnter(Collider other) {
    7.         Destroy(other.gameObject);
    8.         Destroy (gameObject);
    9.     }
    10. }
     
  24. Stealtherald

    Stealtherald

    Joined:
    Mar 22, 2014
    Posts:
    1
    In the JScript example for Shooing Shots in the Update function there is a call to audio.Play(); This causes issues since there is no audio associated with the script yet. This should be removed so others don't have an issue with it.
     
  25. cubusaddendum

    cubusaddendum

    Joined:
    Mar 23, 2014
    Posts:
    8
    Hey Adam,

    I just sailed through Chapter One. Great job!

    Any news on when Chapter Two will be ready? My game needs some *parallax*.

    -Rob.
     
  26. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Parsing Error means that there is an error in the script somewhere and the compiler cannot parse it correctly.

    You will need to go back through the tutorial and double check your code, or compare it with the "done" code in the "done" directory.

    That being said, I do not recognise "StarfighterController". Did you make your own name?

    Lastly, you can post your code, and we can take a look at it and see where it went off the rails.
     
    Sir-Douchebag likes this.
  27. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    We will do additional videos when we can fit them into our schedule.

    Glad you liked them!
     
  28. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This is probably due to a mistake in your declaration of the variable.

    Rewatch this section of the video, as we cover this specifically.

    If you declare: public GameObject shotSpawn;

    ... then you will need to access this with shotSpawn.transform.rotation;

    If, however, you declare public Transform shotSpawn;

    ... then you only need shotSpawn.rotation, as this is of the type transform already.
     
  29. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'll take a look! This could be due to the way these scripts are built upon each other, one lesson at a time.
     
  30. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Thanks for the feedback. We will make additional videos as our schedule allows.
     
    Sir-Douchebag likes this.
  31. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    (I added code tags to your post for better reading...)

    My first suggestion would be to rewatch the video and/or compare your code to the final "done" version in the "done" folder.

    If this doesn't solve your problem, post again here, and we'll do what we can.
     
  32. green vm

    green vm

    Joined:
    Mar 24, 2014
    Posts:
    1
    There is a problem downloading the assets. When I click on open in Unity, it just says "please wait". I tried with IE Firefox on Win 8.1
     
  33. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I recommend that you download the material directly into Unity from Unity.

    To download this project directly into Unity, it's best that you have Unity open and you go to the asset store using Window / Asset Store or use the hot key of <cmd> + 9 (on mac) or <ctrl> + 9 (on win) to open the asset store in the editor and search for Space Shooter. Use the "download" button to download the assets directly into your project.

    You can alternatively follow this link in a browser and select "Open in Unity"; but this doesn't seem to be working for you.

    If, for some reason, you can't get the web link and "open in Unity" to work, and you think it's a bug, you can report a bug by using the bug reporting feature in Unity by navigating to "Help / Report a Bug".
     
  34. Checo

    Checo

    Joined:
    Mar 25, 2014
    Posts:
    2
    Hi, I'm having a problem with the Space Shooter tutorial and would be grateful for some help.

    In Chapter 9 Boundary, after placing the script Boundary, the shot becomes invisible, it follows cloning.
    In the video note that appears in the script folder, TESTER.cs not know if that has something to do.

    First create the cube, change the dimensions as in the video, I put the trigger option, then create the script, add it to the script folder, then copy the script and add, delete and render mesh Mesh filter cube .

    the shot still cloning, but the shot if it becomes invisible when he touches the Box Clollider.

    I watched the video many times, but I dont know what is wrong.

    I completed all the chapters and until 8 correctly.

    If anyone can help me, would be helpful.
    Thank you.
     
    Last edited: Mar 26, 2014
  35. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Checo:

    Are your shots being *destroyed*? Or are they in fact "invisible" and not being rendered?

    I'm not sure I understand "it follows cloning"...

    The "Tester.cs" you are talking about... I believe this was an oversight during recording and it should have been removed. This script is not attached to a GameObject, so it does not affect the scene. If we re-render this video, it will be removed.

    The important points are the code being written in MonoDevelop and the steps being performed in the Unity editor.

    Have you re-watched the video and checked your steps? Have you compared your finished scene with the "done" scene in the "done" folder?

    Some guesses, as I don't have a lot of information:

    - Find out whether the shot is not being rendered or is being destroyed.
    - Check to see if for some reason you are using the code for "OnTriggerExit" NOT "OnTriggerEnter"?

    If you still have issues, please post the details here and we'll try to get you back on track.
     
  36. Checo

    Checo

    Joined:
    Mar 25, 2014
    Posts:
    2
    Hi, Thanks for the reply Adam, I just checked and correct the problem, excellent tutorial.
    Thank you very much.
     
  37. wikious

    wikious

    Joined:
    Mar 27, 2014
    Posts:
    1
    I'm having a similar problem to Checo. I can get the ship to fire once, and then get the error message "MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it." I've compared my code to the done code and aside from minor formatting issues cannot find what's different.
     
  38. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    The missing reference exception is best described by the accompanying details: "The object of type 'GameObject' has been destroyed but you are still trying to access it."

    This means you are referencing an object and then destroying it.

    So - check the reference. This will probably not be a code issue, but rather an assembly issue. Check your scene to the done scene, rather than your code to the done code.

    You could be calling an instantiate, like Instantiate (shot, spawn.position, spawn.rotation); and the "shot" game object is missing when you call it, as it is referenced with public GameObject shot;

    I'm guessing here... Could you have used a "shot" GameObject Instance, rather than the "shot" GameObject prefab? You will want to use your shot prefab in your project view not a shot instance in your scene.

    If this is not the issue (as I am guessing), can you tell us more about your set up?

    Compare the scenes and look for clues, but if your still stuck, post a screen shot of your project view setup and we'll get to the bottom of it.
     
  39. Ruadvin

    Ruadvin

    Joined:
    Mar 28, 2014
    Posts:
    1
    I'm having an issue during this tutorial that I'm eager to learn how to fix. In the Spawning Waves part of the tutorial, I'm following along and creating the first part of the GameController script at about 3:00-3:30.

    The video shows all the asteroids moving straight down the screen (other than the ones that instantly collide with each other and explode), but mine all seem to go off in random directions, including on the Y-axis. A single asteroid that I introduce to the scene to test works just fine, so I figure there is something wrong that I am missing. My code for GameController at this point is as follows:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class GameController : MonoBehaviour
    5. {
    6.     public GameObject hazard;
    7.     public Vector3 spawnValues;
    8.     public int hazardCount;
    9.    
    10.     void Start ()
    11.     {
    12.         SpawnWaves ();
    13.     }
    14.    
    15.     void SpawnWaves ()
    16.     {
    17.         for (int i = 0; i < hazardCount; i++)
    18.         {
    19.             Vector3 spawnPosition = new Vector3 (Random.Range (-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);
    20.             Quaternion spawnRotation = Quaternion.identity;
    21.             Instantiate (hazard, spawnPosition, spawnRotation);
    22.         }
    23.     }
    24. }
    I'm fairly certain I have duplicated the code exactly up to that point on the video. However, I also tried copying the entire GameController example code at the bottom of the page with the video, and the asteroids still move in random directions. I've also checked the 'Done' scene, and those work as they're intended. I'm sure I missed something, but I'm not sure where to begin looking.

    *edit* - To clarify, the asteroids that are instantiated do always travel 'downward' in relation to the Z-axis. My problem is that they also randomly travel left or right at an angle on the X-axis, and 'toward' or 'away' from the camera on the Y-axis.

    *edit 2* - After further poking and prodding, and a bit of experimentation, I realized what was making my asteroids move randomly. Instead of exploding when being instantiated on top of each other (since they were all spawning at the same time), they were 'bouncing' off of one another. I'm still not sure why, I'm fairly certain I followed the tutorial closely. But, continuing with the video, and having them spawn one asteroid every 1/2 seconds fixes the problem, and I get the desired behavior.
     
    Last edited: Apr 1, 2014
  40. Ridlin

    Ridlin

    Joined:
    Mar 12, 2014
    Posts:
    1
    Hi Adam,

    Finished your tutorial and loved it. I was able to get everything going and even added some tweaks of my own. EXCELLENT video. It is very appreciated.
     
  41. MeattWad

    MeattWad

    Joined:
    Apr 3, 2014
    Posts:
    2
    I have just finished this tutorial as well, I did have a few hiccups along the way, but watching, rewatching, pausing and comparing got me through the whole thing.
    I am a complete noob, I have 0 coding experience and this tutorial has me fired up to fix that.

    Thank you for taking the time to make this, It has meant alot to me to make my own game and get started with unity.

    PS, Dying for the next chapter as well.
     
  42. Nephilim_ Shadow

    Nephilim_ Shadow

    Joined:
    Mar 30, 2014
    Posts:
    1
    Hey guys!
    Im new to unity and so far what ive been doing with it ive been having fun. Ive been watching the tutorial on a 2d space shooter and i have ran into a problem. I cant seem to move the ship at all.
    I have my script exactly the same as in the tutorial and i have no errors in the script. Or at least the console isnt showing any. I can go to play mode just fine but my ship wont move. Is there any way to remedy this? Thank you for your time



    thenephilimrising@hotmail.com
     
  43. Metushelah

    Metushelah

    Joined:
    Apr 5, 2014
    Posts:
    3
    Hey Adam,

    I am having problems with my shots disappearing too quickly instead of firing to the edge of the screen.
    From what i could see i didn't have any difference from your code or make up but it's like at some distance from
    my ship they choose to be "destroyed".

    It's clearly something in my Boundary object but i am not sure what, because the script and the Transform and everything is EXACTLY as shown in the video so i am confused.

    Could you please help me?
     
  44. CrazyBulldog

    CrazyBulldog

    Joined:
    Jul 9, 2013
    Posts:
    1
    Hi,
    after importing the assets from the store and moving the player ship into the hierachy window as described in The player gameobject vid i get the following error:

    Unable to open Assets/Models/vehicle_playerShip.FBX: Check external application preferences



    Can anyone help?
     
  45. rock-tsai

    rock-tsai

    Joined:
    Apr 5, 2013
    Posts:
    2
    Open Done_Main.unity, click play button, play game for a while I found in Hierarchy view left many Done_Asteroid_0?(Clone).
    Done_Bolt-Enemy(Clone) and Done_Enemy_Ship(Clone) remove complete. Is it normal?
     
  46. rock-tsai

    rock-tsai

    Joined:
    Apr 5, 2013
    Posts:
    2
    OK, solve this problem. Add Sphere Collider into Done_Asteroid 01 ... Done_Asteroid 03, now it destroy complete.
     
  47. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664

    This is probably due to something like: Not setting the collider to be a "trigger". If this were true, then the colliders would act as standard physics colliders, so would "reject" each other, causing them to fly apart - AND - as a standard physics collider, they wouldn't send the "OnTrigger..." messages, but rather the "OnCollision..." messages. Without the "OnTrigger..." message they would never be destroyed.
     
  48. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Thank you very much for the positive feedback. It makes me very happy!
     
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    We will get that next chapter done as soon as possible. I am tied up doing some lessons on 2D components, but when that is done, I'll move to get that next chapter done.

    Let me know if there are any particular issues that need to be either polished or annotated for clarity!

    I'm glad you've been able to get started with Unity.

    It's a great feeling to complete a game and say "I did that!", isn't it?
     
  50. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    There are two aspects to making things work in Unity - and only one is the scripting.

    The other is the values you set in the exposed Component on the GameObject in the Inspector.

    If you create a variable:

    Code (csharp):
    1. public float speed;
    A value for this must also be set in the inspector.

    Make sure you set your component values in the inspector once you have a script that is written correctly and compiles in Unity.

    If this is not the issue, we'll dig deeper.
     
Thread Status:
Not open for further replies.