Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

unnamed space shooter/sim

Discussion in 'Made With Unity' started by gooongalooo, May 8, 2010.

  1. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
  2. Sam Shiels

    Sam Shiels

    Joined:
    Feb 25, 2007
    Posts:
    160
    Nice work on the graphics! Looks good!
     
  3. Juergen66

    Juergen66

    Guest

    Joined:
    Jan 18, 2010
    Posts:
    8
    Hi,

    this is what I was looking for. Great work!
    is it possible that you post your code?

    Thanks in advance
    Jürgen
     
  4. Mazuho

    Mazuho

    Joined:
    Apr 10, 2008
    Posts:
    37
    Nice work! I won't point out any obvious stuff but rather ask how you made your skybox? Did you do it yourself in photoshop or did you "steal" some space pictures and glue them together?

    Thanks
     
  5. fallingbrickwork

    fallingbrickwork

    Joined:
    Mar 16, 2009
    Posts:
    1,072
    Looks really nice. Great work on the graphics. Looking forward to seeing more of this.

    Best Regards,
    Matt.
     
  6. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    @ jürgen: ja klar, man^^ schau mal hier rein, da steht die lösung. ---> http://forum.unity3d.com/viewtopic.php?t=28761&start=0&postdays=0&postorder=asc&highlight=#

    complet code atm inclusive some useless stuff, so check out what u need for urself (because it´s not finished i have to clean it up sometimes):
    mouse controls.js :
    Code (csharp):
    1. // Hide the cursor
    2. Screen.showCursor = true;
    3. //------------
    4. var rotationMouseSpeed = 0.3; // Scale. Speed of the movement
    5. var rollSpeed = 5.0; //rotation speed zum abrollen rechts links
    6. var forwSpeed = 5.0;
    7. //------------
    8. //mouse direction
    9. function FixedUpdate ()
    10.  
    11. {
    12.    
    13.    MousePosition = Input.mousePosition;
    14.    MousePosition.x = (Screen.height/2) - Input.mousePosition.y;
    15.    MousePosition.y = -(Screen.width/2) + Input.mousePosition.x;
    16.    transform.Rotate(MousePosition * Time.deltaTime * rotationMouseSpeed, Space.Self);
    17. }
    18. /*
    19.     if(Input.GetMouseButton (1))
    20.     {
    21.         MMousePosition = Input.mousePosition;
    22.         MousePosition.x = (Screen.height/2) - Input.mousePosition.y;
    23.         MousePosition.y = -(Screen.width/2) + Input.mousePosition.x;
    24.         transform.Rotate(MousePosition * Time.deltaTime * rotationMouseSpeed, Space.Self);
    25.    }
    26. }
    27. */
    28. function Update()
    29. {
    30. //VORWÄRTS - entlang der eigenen z-achse
    31.        if (Input.GetKey ("w")  Input.GetKey("space"))
    32.     {
    33.         print ("W-Taste gedrückt");
    34.         // Move the object forward along its z axis 1 unit/second.
    35.         transform.Translate((Vector3.forward * Time.deltaTime) * forwSpeed * 1.8);
    36.         //beschleunigung hinzufügen!!!
    37.     }
    38.     else if (Input.GetKey("w"))
    39.     {
    40.         transform.Translate((Vector3.forward * Time.deltaTime) * forwSpeed);
    41.     }
    42. /*  
    43. // steuerungsalternative
    44.     if (Input.GetMouseButton(1)  Input.GetMouseButton(0))
    45.     {
    46.         print ("beide mousebutton gedrückt");
    47.         // Move the object forward along its z axis 1 unit/second.
    48.         transform.Translate((-Vector3.up * Time.deltaTime) * forwSpeed);
    49.         //transform.Translate(0,-0.02,0);
    50.         //beschleunigung hinzufügen!!!
    51.     }
    52. */
    53. //RÜCKWÄRTS - entlang der eigenen z-achse
    54.        if (Input.GetKey ("s"))
    55.     {
    56.         print ("S-Taste gedrückt");
    57.         transform.Translate(-Vector3.forward * Time.deltaTime);
    58.     }
    59. //---------------------------------------------------
    60. //ABROLLEN RECHTS - im moment nur drehen um y achse
    61.    if (Input.GetKey ("d"))
    62.     {
    63.         print ("D-Taste gedrückt");
    64.         transform.Rotate(0,0,-rollSpeed);
    65.     }
    66. //ABROLLEN LINKS - im moment nur drehen um y achsen
    67.    if (Input.GetKey ("a"))
    68.     {
    69.         print ("A-Taste gedrückt");
    70.         transform.Rotate(0,0,rollSpeed);
    71.     }
    72. //------------------------------------------------------
    73. /*  //BOOSTER
    74.     if (Input.GetKey ("space")  Input.GetKey("w"))
    75.     {
    76.         print ("space und w keys are held down");
    77.         // Move the object forward along its z axis 1 unit/second.
    78.         transform.Translate(Vector3.forward * Time.deltaTime * 1.8);
    79.     }
    80. */
    81.  
    82. }

    ...don´t forget to turn off gravity...
    ^^


    @Mazuho

    check: http://alexcpeterson.com/spacescape - free to use tool to create nice skyboxes:)
    it allready includes great presets, BUT there´s one single prob with these skyboxes...u´ll see the tiny edge where the single pics are attached to each other... give it a try and u´ll figure it out.
     
  7. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    Hi,

    The camera feels a little weird. You can smooth the camera movement so it wouldn't look like it's pinned to the spaceship. Just my honest opinion.

    Other than that, looks great. Especially the earth texture is nice quality!
     
  8. Juergen66

    Juergen66

    Guest

    Joined:
    Jan 18, 2010
    Posts:
    8
  9. Zeusk

    Zeusk

    Joined:
    Mar 9, 2010
    Posts:
    9
    nice
     
  10. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    update:
    http://www.burg-halle.de/~st2764/spaceship_controls.html

    controls: mouse + wasd - boost: w+space
    try full screen.
    ---------------
    i still need some advice for a nice working camerafollow script...the smoothfollow.js is really cheesy, it works fine on a terrain, but not in this case...atm the cam is just a child of this ship. i checked the forums, but i didnt found a solution, just wowcams:/ ...but they dont work for me(maybe its my fault...)
    would be nice if somebody could post a script/link/tutorial or something like that. (thx)
    i need a smoooooth cam^^ i know it´s not difficult, but im not a programmer.


    ....and why does unity handle a bumpmap like a normalmap?! does anybody knows a quick solution to fix that? dont want to go back to 3ds max and over work my models with more details, especially big ships-.-

    cya
     
  11. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282
    Great job fatdreads! I think youre defnitelly going on the right way there, as i see you totally own ad modeling/texturing but u need some programming in there yet. Try making the ship have some inertia. And you can easilly make the asteroids collidable by adding some good old unity-2-clicks physics! :>

    Congratz and keep it up!

    Regarding you camera problem, i think you should try Jonathan´s Work it helped me a lot!

    http://forum.unity3d.com/viewtopic.php?t=10

    This should DEFNITELLY do the trick! :>

    Btw i commented you youtube video! Awesome GUI!
     
  12. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    thx for the link, but the copy&paste solution doesnt work...cant add the scripts because something is missing.
    2 types can not be found...
    RayCollion, GOComponent...
    useless without both scripts :/ argh
     
  13. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    All you want to do is slerp between the two quaternions. You dont actually need the update function as its just doing a raycast to get the selected object (which is not really needed anyway).

    For the skybox you might try changing the texture from repeat to clamp.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class ChangableLookAt : MonoBehaviour
    6. {
    7.    public Transform lookAt;
    8.    public float smooth = 5F;
    9.  
    10.    Quaternion lastRotation;
    11.    Quaternion goalRotation;
    12.    
    13.    void FixedUpdate ()
    14.    {
    15.       if (lookAt != null)
    16.       {
    17.          Vector3 difference = lookAt.position - transform.position;
    18.          Quaternion rotation = Quaternion.LookRotation(difference, Vector3.up);
    19.          goalRotation = rotation;
    20.       }
    21.       else
    22.       {
    23.          goalRotation = lastRotation;
    24.       }
    25.    }
    26.  
    27.    void Awake ()
    28.    {
    29.       lastRotation = transform.rotation;
    30.       goalRotation = lastRotation;
    31.    }  
    32.    
    33.    void LateUpdate ()
    34.    {
    35.       lastRotation = Quaternion.Slerp (lastRotation, goalRotation, smooth * Time.deltaTime);
    36.       transform.rotation = lastRotation;
    37.    }
    38. }
     
  14. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    ...and again.....the cam is targeting the ship, but dont follow it:/
    but thx for the try :(

    what do you mean with "from repeat to clamp"?
    the skybox tex dont repeat Oo - 6 planes - 6 different pics
     
  15. NomadKing

    NomadKing

    Joined:
    Feb 11, 2010
    Posts:
    1,461
    I think what aiursrage2k was saying was that if you go to the Project view, select each of the images used in the skybox and then change 'Wrap Mode' to 'Clamp' in the inspector (by default it is on 'Repeat'), it might remove the tiny edge lines you are seeing :)
     
  16. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    ...lol - shame on me :D i found it XD

    i never realized this button... but ive got still this camera problem:/
     
  17. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282

    Sorry but that didnt happened with me at all. :< Well im sry i couldnt help. Good luck tho!
     
  18. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
  19. GoldFire33

    GoldFire33

    Joined:
    Mar 31, 2010
    Posts:
    91
    Are the textures not in the web player? All of the objects are just gray.
     
  20. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    nope, no textures atm as long as i´m not sure which models i use. i dont want to make some uv´s and textures for models i maybe dont use...
     
  21. Juergen66

    Juergen66

    Guest

    Joined:
    Jan 18, 2010
    Posts:
    8
  22. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Wow... your Fighter Model really improved since the first version.
    I like the technical look much better than this "organic evil"-stuff of the first webplayer.
    I also like the way, you put details on the capital ships. Cant wait to see textured versions :)
    Very nice work. Keep it up!

    Cheers

    Frank
     
  23. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    thx :) yes, i´ll keep going! the scripting part is very difficult to me, because i´m not a programmer... but learning by doing^^
     
  24. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
  25. OldMonk

    OldMonk

    Joined:
    May 22, 2010
    Posts:
    22
    Very cool. The ship rotating looks really cool. I also really like the effect of the moving stars. How did you do that?
     
  26. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
    yo monk,

    the "moving stars" are just a simple particle system around the ship. the renderer got a modifier called velocity scale... play around with the value, thats all. :roll:

     
  27. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
  28. dbp

    dbp

    Joined:
    Mar 3, 2010
    Posts:
    324
    the mouse seems to be a bit too sensitive in my opinion, maybe you could allow the user to configure the sensitivity. other than that great work, it looks really nice so far.
     
  29. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140
  30. gooongalooo

    gooongalooo

    Joined:
    May 6, 2010
    Posts:
    140