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.
  2. Dismiss Notice

[WIP] My first commercial 2D Game "Quest"

Discussion in 'Works In Progress - Archive' started by Abhijit-Mukherjee, Jan 16, 2015.

  1. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Screenshots_2015-01-27-00-17-52.png Dear Brothers and Sisters ,

    Recently I am working on a 2D game called "Quest " using Unity 4.5.1 Free , still it is not ready . I have started with small steps , miles to go . Right now I am working on character animation and back ground designing . I am stuck on character Jump animation .

    I will keep on posting my progress on this thread . I need your guidance as I am a beginner Game Programmer .


    This is my first game .. I am spending lots of time on it ... yesterday night I just finished the jump animation .. I am not an artist so it been very heard for me to make an character and put live on it .. After a long night work I some how manage to complete the jump animation . I really don't know how other will accept it .. I am working on 30 days trial version of Fl software for creating an animation and character too .


    Issue 1 # Need Help ! Is Solved Now (Thanks Nasso)

    I have two camera one Main Camera and another one Player follow camera. Player follow camera is attached with player object .

    Now when the player object is destroyed the player follow camera also getting destroyed And my main camera giving me the old view which is not in the current position where player got destroyed . How can i set the view to player destroyed position ? or is there other way to do that ?. What is the best practice i should follow ?

    Issue #2 This Issue is Solved ( Thanks to MickM and Nasso)
    Background Sound and player walk sound is overlapping each other .. what is the best way I can place different sound altogether .


    Currently I am working on Sound Integration with my Game (Done)
    1) Back Ground Sound
    2) Running Sound.
    3)Jump Sound.
    4) Coin Collect Sound
    5) Die Sound .

    Progress Of my game .

    Yesterday I am able to build few UI (Starting UI and Game Over UI ) and there interaction with user event . Feeling Confident :)

    I have made UI by my own :)

    Please Check End Level Screen . Let me know how it looks ? QuestImage.PNG

    I have started working on Unity UI .

    I need your guidance and comment to keep up my game development.
     
    Last edited: Feb 8, 2015
  2. CodeName-47

    CodeName-47

    Joined:
    Jan 16, 2015
    Posts:
    1
    Dada Ki khobar ... ami bhi natun ekhane ... stay in touch ...
     
  3. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Please complete the profile information .
     
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,841
    Why not use one camera and remove it from the player parent before destroying him.

    Do something like

    Camera.main.transform.parent = null;

    to bring it back to the root of the hierarchy for example. Then call Destroy(player);
     
    Abhijit-Mukherjee likes this.
  5. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Hi thanks for the reply .. Let me try ...
     
  6. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    nasos_333 ... Thanks buddy it works .. But one problem ... the camera is pointing to beginning stage .. it is not pointing to where my player died .. am I missing some thing .
     
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,841
    Normally when removing the parent, the camera should keep its global properties, so as long as the camera looked at the hero, it should continue to do so. Check if there are any scripts attached to the camera that point the camera to a target.

    If a "lookat" script pointed the camera to the hero position, maybe it has now lost the hero and thus point to 0,0,0 or something, as a default position.

    Also make sure the camera is not re-parented somehwere else by another script.
     
  8. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    ok .. Buddy .... Let me check
     
  9. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    void Explode()
    {

    var cameraTransform = Camera.main.transform;
    // make it a child of the current object
    Transform trns = transform;
    trns.position = new Vector3 (transform.position.x,3.314256f, -0.008056641f);
    cameraTransform.parent = trns ;
    // place it behind the current object
    cameraTransform.localPosition = -Vector3.forward * 5;

    Camera.main.transform.parent = null;
    // make it point towards the object
    cameraTransform.LookAt(trns);



    //destroy our game object
    Destroy(playerObject);


    }


    I did this . Now it is working fine for me . I have hard coded y, and Z because I don't want to change this .

    Thanks nasos_333 .
     
  10. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    please find my code below ... the problem is solved now .. thanks ..buddy
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,841
    Great :), glad to be of help.

    About the sound issue, i think you have to separate your background sound from the local sounds. What is the problem exactly, does one sound seem to stop or the other seems to overly override it ?

    Where do you place your main music and where the hero steps ?
     
    Abhijit-Mukherjee likes this.
  12. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Hi Nesso ... actualy I have placed audio source with main camera ... for background sound .. and set loop and play on awake setting ...

    for my hero game object I have placed running sound attached with audio source . once I hit the runn button my runn sound should play one shot .. and it is playing so ..

    what is the problem actually I feel ... the sound itself ..

    my running sound length is big and loud .. so evey update it is plying and multiple running sound is plying ..

    buddy please how should I place proper sound for background and also runn and jump .. the runn sound clip should end when my runn animation stopped ..

    Thanks nesso ..
     
  13. MickM

    MickM

    Joined:
    Nov 19, 2012
    Posts:
    166
    What is your audio specific code?
     
    Abhijit-Mukherjee likes this.
  14. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Hi MickM Please find my code below .

    //------------------------------------Sound-------//
    public AudioClip runnSoundClip ;
    private AudioSource audioSource ;
    void Awake()
    {
    audioSource = GetComponent<AudioSource> ();

    }

    void FixedUpdate () {


    foreach (Touch touches in Input.touches) {
    if (moveUp.guiTexture.HitTest (touches.position) && touches.phase != TouchPhase.Ended)
    {
    anim.SetBool ("jump", true);
    jump = true;

    }
    if (moveLeft.guiTexture.HitTest (touches.position) && touches.phase != TouchPhase.Ended) {
    if(audioSource.isPlaying){
    audioSource.Stop();
    }
    audioSource.PlayOneShot (runnSoundClip,10.0f);



    }
    if (moveRight.guiTexture.HitTest (touches.position) && touches.phase != TouchPhase.Ended) {
    if(audioSource.isPlaying){
    audioSource.Stop();
    }
    audioSource.PlayOneShot (runnSoundClip,10.0f);


    }
    }
    }
     
  15. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    I am using Asset Store Foot Step Free Sound ... As Sound Clip
     
  16. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,841
    The problem with sound is that we have no way to know what the result is or what you hear, so it is hard to debug.

    How about trying to cut off the PlayOneShot when the sound is playing.

    Like

    if(audioSource.isPlaying){

    }
    else{
    audioSource.PlayOneShot (runnSoundClip,10.0f);
    }
     
  17. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Hi Nasos ,

    I found out the problem .. yes you are right ... I did it other away just now after so many R&D .... main problem was with
    audioSource.PlayOneShot (runnSoundClip,10.0f); function . The problem was it is playing every time on fixed update on pressing the forward button .. so many sound instance is overriding each other and crating a outer world sound :) .

    So actuly what I did is from Audio source , I checked Loop and play on Awake both and also checked mute too ..
    .. Now from my script I am just doing audioSource.mute = true or false .

    Thanks Nasos ..
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,841
    np :), glad to be of help and that you solved the issue.

    Sound is a bit hard to get right.
     
    Abhijit-Mukherjee likes this.
  19. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Yaa ya ... many more miles to go :)
     
    nasos_333 likes this.