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

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Mar 26, 2015.

  1. Simon1964

    Simon1964

    Joined:
    Jul 29, 2017
    Posts:
    12
    Thanks. I just had a repeat with getting the public variable PlayerEplosion into the astroid inspector. I tried logging out and back in again but in the end the only thing that worked was

    Exiting and restarting Unity!!!!

    This has got to be a bug in Unity 5.1 right?
     
  2. Simon1964

    Simon1964

    Joined:
    Jul 29, 2017
    Posts:
    12
    I'm having the same problem. I've checked and unchecked the play on awake. What happens when I put the "explosion_asteroid" audio in the explosion_asteroid" prefab is that it also then appears in the Hierarchy. This doesn't happen in the tutorial so I guess it's a development in unity 2017. There's nothing in the update guide neither.

    Does anyone know of a workaround?
     
    Last edited: Jul 30, 2017
  3. PoulpX

    PoulpX

    Joined:
    Jul 27, 2017
    Posts:
    2
    Hello, I just found the issue of my problem it was due to my mover script was under the evasive script, so at the time we moved the enemy there was no speed defined.
     
  4. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Ah, an update for the VS Community 2017 method:

    File--> Save myfile.cs As

    In the save pop, click the SAVE option box:
    upload_2017-7-31_9-54-12.png
    And select
    Save with Encoding
    from the dropdown
    upload_2017-7-31_9-55-14.jpeg

    That should do it
     
  5. GhostRafa

    GhostRafa

    Joined:
    Jul 20, 2017
    Posts:
    2
    Hello, my bolts are running out in the middle of the game and i have no idea what
    is triggering it. Is there anything I could do?

    It turns out my bolt get deleted when it hits an asteroid. How do you fix that?
     
    Last edited: Aug 1, 2017
  6. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    For some reason my player object just pushes the asteroid off the screen instead of exploding on contact. Not sure where I should be looking to solve the issue, let alone what the issue may be.

    Edit: I hadn't clicked the player "Is Trigger" box.
     
    Last edited: Jul 31, 2017
  7. Simon1964

    Simon1964

    Joined:
    Jul 29, 2017
    Posts:
    12
    I've got to the end of the tutorial but can't build for WebGL. I can build for PC ok.
    With WebGL I get a load of errors.





    followed by



    Followed by


    Followed by


    followed by




    followed by



    followed by



    followed by



    followed by

    UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEditor.HostView:OnGUI()

    Every time I try to build I get errors. I sorted every problem out during the tutorial but this I can't figure out.
     
    Last edited: Jul 31, 2017
  8. CParis212

    CParis212

    Joined:
    Aug 2, 2017
    Posts:
    5
    Hey in 2017 there isn't a web player what do i use instead.
     
  9. kudryavi

    kudryavi

    Joined:
    Aug 2, 2017
    Posts:
    2
    Hello!
    Tell me why when I remove the tick Mesh Collider, the player disappears, and the green lines do not appear?
     
  10. kudryavi

    kudryavi

    Joined:
    Aug 2, 2017
    Posts:
    2
    Probably WebGL)
     
  11. CParis212

    CParis212

    Joined:
    Aug 2, 2017
    Posts:
    5
    I appreciate it!!! im trying to learn i finished the roll a ball at like2a.m. last night and started this one today.
     
  12. CParis212

    CParis212

    Joined:
    Aug 2, 2017
    Posts:
    5
    hey it explains that in one of the roll a ball tutorials at like 6 i believe or around there.
     
  13. marcinje

    marcinje

    Joined:
    Aug 3, 2017
    Posts:
    1
    Has anyone lost whole scene while building for ios on macos? I have gone through whole roll a ball tutorial and then build for macos went ok, but build for ios went very bad - I have lost whole scene. I admit that my xcode wasn't fully configured / installed - maybe that was the problem. Thankfully I found some github repo with this project so - no big deal. But I hope this will never happen again.
     
  14. BrewNCode

    BrewNCode

    Joined:
    Feb 17, 2017
    Posts:
    372
    Is this tutorial compatible with the latest release of Unity? Like, 100%
     
  15. Deleted User

    Deleted User

    Guest

    I dont understand why this line works: if (Input.GetButton("Fire1") && Time.time > nextFire)
    while we haven't initialized nextFire anywhere in the code...when it reaches that if statement, how does it evaluate Time.time > nextFire ? (if nextFire has no value in it...)
     
  16. shade52

    shade52

    Joined:
    Aug 5, 2017
    Posts:
    1
    I'm on the part where you create a boundary to destroy objects leaving the game, and it doesn't work. I did everything the tutorial said, I double checked my code, I double checked the dimensions of the cube, nothing works. I tried to adjust the y axis but the bolts spawn inside the cube and they still don't work. How the hell do I get this thing to work?
     
  17. Deleted User

    Deleted User

    Guest

    I did this tutorial today and it all worked for me.
    maybe you can tell us what happens when you run the game at that point?
    post some screenshots of the Hierarchy when in-game so that we see the bolts still remain inside the game and not getting destroyed.
    and the code and settings(the inspector view) for the boundary and we'll continue from there...
     
  18. Deleted User

    Deleted User

    Guest

    I've finished the tutorial and built the game but unlike the tutorial, it didn't create just 2 files (index.html and .unity3d) , instead it created .html and 2 more folders (1 is Builds, and 1 is TemplateData)...
    Also when I open the index.html file in Chrome it doesn't load the game at all.
    But when I open it in Edge it works fine, so you might want to add that and/or a solution in an annotation in the last video.

    Also there's this warning:
    "
    Assets/Scripts/GameController.cs(38,29): warning CS0618: `UnityEngine.Application.LoadLevel(int)' is obsolete: `Use SceneManager.LoadScene'
    "
    apparently the Application.LoadLevel is no longer the appropriate use here...might want to add that as well.
    Thanks.
     
  19. legoblaster1234

    legoblaster1234

    Joined:
    Aug 7, 2017
    Posts:
    27
    t.png I'm having a issue with compiling the project.
    When I open the build settings window and search for "Web Player" and I can't find it.
    The closest thing I can find is "WebGL" and when I use that (after crashing unity the first try) and open the "Index.html" file it makes I just get a blank screen with the unity logo, "WebGL", "SpaceShooter" and a non-functional full screen button.
     
  20. Deleted User

    Deleted User

    Guest

    try to open in another browser, this happens to me as well when using Chrome.
    Try to use Internet Explorer, worked for me.
     
  21. Maiels

    Maiels

    Joined:
    Aug 7, 2017
    Posts:
    2
    Hi! I just started working with Unity and thought I should give all those tutorials a go. I currently finished the Extended version of the Space Shooter tutorial but at the end I ran into some trouble. As a side note, I compared all my code several times (I might have missed something anyway) and it seems to be fine. My problem is that after I was done writing the Evasive Maneuver code my ship start flying backwards...like not respecting boundaries and just flying away. I noticed that somehow if they spawn outside I can shoot them. I do not even know what code sample to give as I already double checked it...

    Thank you for your time!

    #EDIT

    I, once again, tested the Code, I compared it to the one in the tutorial and I do not seem to find any mistakes. But upon some testing I think I found the culprit.

    Code (CSharp):
    1. rb.velocity = new Vector3 (newManeuver, 0.0f, currentSpeed);
    I changed the
    Code (CSharp):
    1. newManeuver
    to a random value ( number 2) and the ship started going to the left. If I go up to the
    Code (CSharp):
    1. while(true)
    2. {
    3.    ...
    4. }
    I do not seems to find any mistakes.

    P.S.: The ship just flies away ( really fast) backwards. To see what is happening I also made the Main Camera in Perspective mode and zoomed out . Apparently the ships are spawning but they disappear in a fraction of a second, I believe because of the Boundary limitations and the fact that they fly backwards.

    I really cant figure out what is happening. Thank you!

    #FIXED

    My own lack of attention was the problem. I had named the
    Code (CSharp):
    1. rb.position
    as
    Code (CSharp):
    1.  rb.velocity
    and of course the ship was staying in place, it had no function to tell it to move!

    I really am kind of embarrassed for such a mistake but I got to learn for this. Maybe someone reads this and thinks twice after posting a problem!
     
    Last edited: Aug 9, 2017
  22. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    In the live video about Extending the game around 1:09:45 the enemy ship passes through the player and triggers both explosions but doesn't destroy either game object. We are told that this is because the Game Controller script has been deactivated the "Add score" part of the DestroyByContact script.
    When I do this both game objects are destroyed as they collide and the only way to stop it happening is if I comment out the "Destroy" statements below the "Addscore" statement, which isn't done in the video.

    Any ideas why this is happening? Is it possibly because we are using the updated code without "helper references"?
     
  23. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    Another quick and frustrating problem I'm having. My enemy ships don't move down the screen, they just sit at the top barely poking into the game view whilst shooting and doing their evasive maneuvers.

    Here are some screenshots of my scripts and unity window
    Mover script
    Evasive Maneuver script
    Unity Window Full View and Inspector

    Any help would be greatly appreciated.
     
  24. dazbarthram

    dazbarthram

    Joined:
    Jul 25, 2014
    Posts:
    3
    Connarhea, I noticed a little issue from the Unity Window Full View image you post, check the Mover Script on the Enemy Ship is turned on. Make sure it is applied to the prefab. Hope this helps, Daz.
     
  25. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    Oh sorry, I must have taken that when I was messing around with deactivating and reactivating things to find where the issue was. The mover script is on in the prefab and on all instances when I click play but the issue remains.
     
  26. dazbarthram

    dazbarthram

    Joined:
    Jul 25, 2014
    Posts:
    3
    Hi Guys,

    Thought this might be helpful, allowing for testing WebGL builds in Google Chrome.
    I am using Windows 10, with Google Chrome Version 60.0.3112.90 (Official Build) (64-bit) .
    But decided to create a shortcut to Chrome with the extra --allow-file-access-from-files option added (see window screenshot below), now open Chrome with this shortcut, and just drag your index.html file into the chrome window to run it locally, or drag the index html onto the shortcut icon to automatically open and run it. This is an alternative to the Build and Run option in Unity.
    Hope this helps someone.

    Cheers Daz.


    upload_2017-8-8_21-57-51.png
     
  27. dazbarthram

    dazbarthram

    Joined:
    Jul 25, 2014
    Posts:
    3
    Connarhea,

    I also notice in the EvasiveManeuver script, in the FixedUpdate method, check the last line, the rb.rotation should be :
    rb.rotation = Quaternion.Euler(0.0f,0.0f,rb.velocity.x - tilt
    Take out the * you have before -tilt

    Try that out.
    Cheers Daz.
     
  28. johnweland

    johnweland

    Joined:
    Aug 7, 2017
    Posts:
    2
    So I'm not a wizard yet, but I've dabbled a bit in Unity and decided I should go back and do the tutorials that I hastily skipped early on.

    So I am following the shooter tutorial and I made sure my Asteroid's position and rotation are set to zero, I move it +8 on the Z axis. All seems fine, I apply the rotation with ...

    Code (CSharp):
    1. void Start () {
    2.         _astroid = GetComponent<Rigidbody>();
    3.         _astroid.angularVelocity = Random.insideUnitSphere * tumble;
    4.     }
    and it doesn't just effect the rotation but rather the position as well. as soon as I start the scene the asteroid begins moving in a random direction, often with a heavy tilt on the y axis plus or minus. This causes the asteroid to be above or below the play field so shots will go over or under it.

    To combat it I wen to the asteroid rigid body and added constraint to the y position. This seemed to work until I added the mover script to the asteroid which now when you play the scene the asteroid moves off to an angle in relation to its rotation.
     
  29. GeraltDieSocke

    GeraltDieSocke

    Joined:
    Aug 9, 2017
    Posts:
    3
    I'm at 1 Setting up the project.
    I have a problem. On the video in the Game Tab you can see the portrait like it is a canvas on portrait mode.
    On my Unity it looks like a 3d room with a sky.

    Screenshot: http://prntscr.com/g6dxos

    What did I do wrong? I followed the guide step by step. Made a new Unity Project set the build target to WebGL (because Web Player doesn't exist anymore) and imported all the assets.

    What is the problem?
     
  30. johnweland

    johnweland

    Joined:
    Aug 7, 2017
    Posts:
    2

    How far along are you in the tutorials? In some later episodes around unity 1 you remove the skybox and change the perspective of the camera.
     
  31. GeraltDieSocke

    GeraltDieSocke

    Joined:
    Aug 9, 2017
    Posts:
    3
    Im at 01.01 Setting up the project. He hadn't done it yet so I should just continue watching? Thx
     
  32. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    I'm sure it's because he has the older version of Unity. This didn't have the skybox you can see in yours. When he comes to setting up the lighting for the game there are some annotations (turn them on at the bottom right of the video) and an upgrade guide (explains the changes in newer versions of Unity) explaining how to delete the skybox.
     
  33. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    Thanks again for spotting another error Daz, sadly it has done nothing to the game. The enemy ships are still stuck at the top of the screen and are doing their evasive maneuvers just not moving down.
     
  34. GabLog

    GabLog

    Joined:
    Aug 10, 2017
    Posts:
    8
    Hi everyone, I'm new with Unity and i'm working with the tutorials, but i got a problem with the space shooter: when the player shoots bolts, these are vertical and cannot be seen from the top view. They are there (rotating the camera i can see them) but are vertically spawned, but if i drag them from the prefabs they are correctly shown. I thought the Shot Spawn might be the problem, but i can't see why, it has no rotation set up. Even if i try to rotate the bolt in the prefabs, it rotates only when dragged into the hierarchy windows, but when it's shotit doesn't change, but it's strange the dimension does change when shot if i modify the parameters. Does anyone have an idea on how to solve this? thanks in advance
     
  35. Paliandro

    Paliandro

    Joined:
    Aug 9, 2017
    Posts:
    20
    So, working through this tutorial.
    I got to the part where we are setting the ship unable to escape the playfield, but I keep gettinmg the error for my vector3 that it doesn't contain a constructor that can contain 4 arguments. I've tried to fiddle arround with it, but haven't managed to get it cleared.
    What am I doing wrong here?
     

    Attached Files:

  36. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Line 21 has "0, 0f,"
    should be "0.0f"
     
  37. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    It's been suggested that I drop my code into here from my earlier issue so that anyone who may be able to help could copy and paste it rather than just look at it.

    So here goes:
    Code (csharp):
    1.  
    2. public class Mover : MonoBehaviour
    3. {
    4.     private Rigidbody rb;
    5.  
    6.     public float speed;
    7.  
    8.     private void Start()
    9.     {
    10.         rb = GetComponent<Rigidbody>();
    11.         rb.velocity = transform.forward * speed;      
    12.     }
    13. }
    14.  
    Code (csharp):
    1.  
    2. public class EvasiveManeuver : MonoBehaviour {
    3.  
    4.     public float dodge;
    5.     public float smoothing;
    6.     public float tilt;
    7.     public Vector2 startWait;  
    8.     public Vector2 maneuverTime;
    9.     public Vector2 maneuverWait;
    10.     public Boundary boundary;
    11.  
    12.     private float currentSpeed;
    13.     private float targetManeuver;
    14.     private Rigidbody rb;
    15.  
    16.     void Start ()
    17.     {
    18.         rb = GetComponent<Rigidbody>();
    19.         currentSpeed = rb.velocity.z;
    20.         StartCoroutine(Evade());
    21.     }
    22.  
    23.     IEnumerator Evade ()
    24.     {
    25.         yield return new WaitForSeconds(Random.Range(startWait.x, startWait.y));
    26.  
    27.         while (true)
    28.         {
    29.             targetManeuver = Random.Range(1, dodge) * -Mathf.Sign (transform.position.x);
    30.             yield return new WaitForSeconds(Random.Range (maneuverTime.x, maneuverTime.y));
    31.             targetManeuver = 0;
    32.             yield return new WaitForSeconds(Random.Range (maneuverWait.x, maneuverWait.y));
    33.         }        
    34.     }
    35.  
    36.     void FixedUpdate ()
    37.     {
    38.  
    39.         float newManeuver = Mathf.MoveTowards(rb.velocity.x, targetManeuver, Time.deltaTime * smoothing);
    40.         rb.velocity = new Vector3(newManeuver, 0.0f, currentSpeed);
    41.         rb.position = new Vector3
    42.         (
    43.             Mathf.Clamp(rb.position.x, boundary.xMin, boundary.xMax),
    44.             0.0f,
    45.             Mathf.Clamp(rb.position.z, boundary.zMin, boundary.zMax)
    46.         );
    47.  
    48.         rb.rotation = Quaternion.Euler(0, 0, rb.velocity.x -tilt);  
    49.     }
    50. }
    51.  
     
  38. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Please confirm the mover script has a value for speed in Unity:
    upload_2017-8-12_18-12-42.png

    Even to where you temporarily modify Mover script
    from: rb.velocity = transform.forward * speed;
    to: rb.velocity = transform.forward * -5f;


    Check the Unity setup on your prefab enemy ships:
    upload_2017-8-12_18-16-57.png
     
  39. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    Doing this only caused all the other game objects with the script attached to behave differently (change of speed direction etc) but not the enemy ship. It's the only gameobject that has this script but isn't moving.
    By this do you mean check to see if the images you posted match my inspector?
    Everything is the same as in your picture (except values in certain scripts ie Evasive Maneuvers). I even tried making rb public and manually assigning the rigidbody but that had no effect either.
     
  40. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    Upon trying to debug the issue another way I found that using this code
    Code (csharp):
    1. private void FixedUpdate()
    2.     {
    3.         if (gameObject.layer == 8)
    4.         {
    5.             print (rb.velocity);
    6.         }
    7.     }
    and setting the enemy ship on a custom layer I get these results:

    (0.2, 0.0, 0.0)
    UnityEngine.MonoBehaviour:print(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:21)

    (0.3, 0.0, 0.0)
    UnityEngine.MonoBehaviour:print(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:21)

    (0.5, 0.0, 0.0)
    UnityEngine.MonoBehaviour:print(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:21)


    and so on and so forth.

    This means the Evasive Maneuver script is working but nothing is being assigned in the z axis.

    (Also, is this even considered a viable way to debug?)
     
  41. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Personally, I would use Debug.Log instead of Print, and then view the console log for the messages.

    Then, instead of using a custom layer, you might check
    if (gameObject.name == "EnemyShip")
    or
    if (gameObject.tag == "Enemy")

    Debug.Log("Speed=" + currentSpeed + ", rb.velocity=" + rb.velocity);

    I think this is valid code, I'm cant currently fire up Unity to check it, sorry.
    When I get home, I'll insert this code into my game and see what values are displayed.
     
  42. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    I wanted to use the name of the object but couldn't wrap my head around how to access it (beyond obvious now). I knew about Debug.Log but I'm still not certain on the differences between that and print and as I knew print would put it straight into the Console.

    I knew I couldn't use "Enemy" tag because the asteroids and enemy bolt are tagged with it and changing the Enemy Ship to a new tag may cause issues within the other scripts, so to the layers I went :)


    With some small variations I used the code snippet you gave me and targetted the "Enemy Ship(Clone)" and got results like this:

    Speed=-5, rb.velocity=(0.9, 0.0, 0.0)
    UnityEngine.Debug:Log(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:21)

    Speed=-5, rb.velocity=(0.4, 0.0, 0.0)
    UnityEngine.Debug:Log(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:21)
     
  43. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Try modifying line 48 of EvasiveManeuver
    from: rb.rotation = Quaternion.Euler(0, 0, rb.velocity.x -tilt);
    to: rb.rotation = Quaternion.Euler(0, 0, rb.velocity.x * -tilt);

    (Note we are multiplying rb.velocity.x by -tilt)

    This wont make any difference though. You are correct that you're axis are incorrect.
    I have added to my code:

    Code (csharp):
    1.  
    2. public class Mover : MonoBehaviour {
    3. ...
    4.     {
    5.         Debug.Log("Debug!Mover:FixedUpdate: Speed=" + speed + ", rb.velocity=" + rb.velocity);
    6.     }
    7.  
    Code (csharp):
    1.  
    2. public class Evasive : MonoBehaviour {
    3. ...
    4.     void FixedUpdate()
    5.     {
    6.         Debug.Log("Debug!Evasive:FixedUpdate: Speed=" + currentSpeed + ", GetComponent<Rigidbody>().velocity=" + GetComponent<Rigidbody>().velocity);
    7. ...
    8.  
    My console log shows:
    upload_2017-8-14_16-41-12.png

    So, are you're asteroids (which move correctly) also moving in the X axis (like your enemy ship), or are they moving in the Z axis?
     
  44. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    I was originally told to remove the "*" that's why that isn't there.

    I thought my axis are correct, the enemy ships are dodging along the x left and right but not travelling down the z onto the screen and towards the player
     
  45. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Sorry, I wish I could be more helpful.

    I'm a bit suspicious of you're rb.velocity values both that the axis are different from mine, and the unit values themselves are fractional values of the speed value. I.e. in your output
    Speed=-5, rb.velocity=(0.4, 0.0, 0.0)
    why is the first value a 0.4 and not -5?

    I would do a print of the values of the asteroid (which does seem to work) to compare to the enemy spaceship.
    Perhaps if you could post some screenshots of your settings in Unity
     
  46. Mrshevill

    Mrshevill

    Joined:
    Jul 24, 2017
    Posts:
    1
    I'm desperate for help please!
    I've finished the main Tutorial and created a working version of the game, after a week I've decided to come back and add the advanced bits in... ONLY TO FIND that when i open the project and press play to test it now suddenly doesn't instantiate any asteroids and all placement text remains on screen all the time, it seems as if the game controller itself isn't working somehow but i can't for the life of me figure out why.

    it lets me test the game though which is strange and the last time i had it open it was a completed game, I even exported a done version for my laptop. Now it's like something has changed in between!

    I'm desperate to move on with the advanced add on tutorial so any help would be greatly appreciated!
     
  47. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Any (error) messages in the console log?
     
  48. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    Here's what I've got from debugging the mover script.

    Ship: Speed = -5, rb.velocity = (-1.0, 0.0, 0.0)
    UnityEngine.Debug:Log(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:20)

    Asteroid: Speed = -5, rb.velocity = (0.0, 0.0, -5.0)
    UnityEngine.Debug:Log(Object)
    Mover:FixedUpdate() (at Assets/Scripts/Mover.cs:23)


    Obviously the ships x speed varies because it is a random number in the evasive maneuver script but that's showing that it is in fact moving in the x and the asteroid is moving down the z.

    When you say the Unity settings what part do you mean? I will happily screenshot anything that may help :)

    Also, thank you for all the replies you've given so far, the help has been very much appreciated.
     
  49. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    When you say the Unity settings what part do you mean? I will happily screenshot anything that may help

    A screenshot of the values for the various objects as they appear in the inspector.



    Before you do anything else, make absolutely sure that nothing is referencing the “_Complete-Game” directory.
    With Unity completely closed down use your file manager to move the “_Complete-Game” directory outside of the project directory.
    For example my original project tree in MS Windows was:
    I:\programs\Unity Projects\SpaceShooter\Assets\_Complete-Game (which includes a scripts folder)
    I moved it to
    I:\temp\Unity Projects\SpaceShooter\Assets\_Complete-Game
    Note I also moved _Complete-Game.meta over to I:|temp

    Now, restart Unity, start the game and make sure there are no errors in the console log. If so, you can be pretty confident that there are no improper references to scripts, objects, prefabs, or anything else.

    Yea, this is how an old wives tail starts, but I have seen grief when things from the "Completed" game accidentally get put into the actual game.
    I suppose it's just some stuff, and there are probably fixes, etc etc etc.





    The GameController.
    upload_2017-8-16_21-47-22.png



    Background
    upload_2017-8-16_21-47-49.png




    The EnemyShip is posted above (post #2638). Here’s the vehicle_enemyShip child of it
    upload_2017-8-16_21-48-22.png
     
    Last edited: Aug 17, 2017
  50. Connarhea

    Connarhea

    Joined:
    Mar 29, 2015
    Posts:
    19
    OK here goes:









    I deleted the complete game folder and still nothing. Anything else you need?