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

2D Endless Runner Kit

Discussion in 'Assets and Asset Store' started by OussamaB, Jul 15, 2014.

  1. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    Hi @SoumiDelRio, you are selling this asset in chupamobile store too? I found the same asset in the Unity section of chupamobile.com store..
     
  2. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hello. Thank you for your kind, I really appreciate it.

    1) If I understood correctly, you'd like the player to purchase power-ups then these power-ups will spawn randomly in the game. If yes then that's currently unavailable however I can do some code modification to meet your request. The current power-up system includes two types of power-ups:
    * Power-ups that spawn randomly in the game and which can be upgraded from the shop.
    * Power-ups that you can directly buy from the shop then they appear as buttons in the game so that they can be used whenever you want. (Note that you can limit the time these are shown).
    The creation of these power-ups and their customization is all done from the inspector.

    2) I guess that's some Unity issue. Can you try to deploy to a smartphone to see if the problem still persists?

    Cheers,
     
  3. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It has the same art which has been created by Kenney which has been credited in my asset, so I'm not really sure if it has the same code. I'm going to contact the website and ask them to check if it's the same or not.
     
  4. TofuS

    TofuS

    Joined:
    Oct 27, 2015
    Posts:
    9
    Hey, this is what i mean. I made a video showing that i want it to be used like the magnet power up, and also can be spawnable in game at the same time. The magnet one works but the others don't work like the shield etc. Good example is like the 2D infinite Runner Kit where you buy power up and use in the game and also can be collected in the game while you play.

    https://drive.google.com/file/d/0B6JOrkFIoY4kd3luTXVfQmdMUVU/view?usp=sharing

    Another Bug i found is the music on and off. Even i click on or off it just stays on. Also everything resets back. Its Showed in the video.

    https://drive.google.com/file/d/0B6JOrkFIoY4kZVQzaElWT2o3Rms/view?usp=sharing

    But other than that, those were the 2 problems. Please help. Thank you.
     
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thanks for reporting those bugs, I'm looking into them and an update should be submitted by this Sunday. The update will also the new type of power-ups you mentioned.
     
  6. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The first issue is not really a bug. You need to have as much consumable power-ups buttons as the amount of non-spawnable power-ups in the game. So if you have 3 power-ups that are activated on start, you need to create 3 buttons (duplicate the one in the demo) and place each one of these buttons in the "ConsPowerUPsButtons" array in the "UIManager" inspector.
     
  7. TofuS

    TofuS

    Joined:
    Oct 27, 2015
    Posts:
    9
    Thanks. Got it up and going cheers mate.
     
  8. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    2D Endless Runner Kit v1.05 has been submitted:

    - Fixed a bug in saving/loading audio settings.
    - Added a new type of power-up: Power-UPs that are purchasable from the shop and spawn randomly in the game.

    The update will available to download soon.
     
  9. TofuS

    TofuS

    Joined:
    Oct 27, 2015
    Posts:
    9
    Hi. Was wondering if anyone could give me some guidance on how to make each character have their own background and different level maybe.
    Thanks guys.
     
  10. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I will send you by tomorrow a modified "BackgroundManager" script that will allow you to assign a background for each character, just PM me your e-mail. As for making a different level for each character, mind clarifying what exactly will be changed when the character changes?
     
    Ultrapp likes this.
  11. TofuS

    TofuS

    Joined:
    Oct 27, 2015
    Posts:
    9
    I was wondering if you received my private message. Don't know how to private message but started a separate conversation with my email in it? Is that how i contact privately or there is another way. Cheers
     
  12. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hi, just replied to your PM.
     
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    2D Endless Runner Kit v1.05 is now available on the asset store!

    Please check your e-mail, I have sent you all the required code modifications.
     
  14. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Hi SoumiDelRio....!
    I'm trying to add money reward with a button through "Unity Ads" and add 280 coins ...
    But I can not...
    In the Script of "VideosUnityScript.cs" there is a function called AdCallbackhandler to contine the "ShowResult.Finished" option that is when the video is completed and should deliver reward, .... but as I add these coins to the total result Player ? ...... that variable and use the code as I do to make it?
    Can you help me please? .... I leave the files that I'm using to do this.


    VideosUnityScript.cs
    https://drive.google.com/file/d/0B8YNgQXSI8KISk5jYUxqVGdGYkk/view?usp=sharing

    PlayerMovement.cs
    https://drive.google.com/file/d/0B8YNgQXSI8KId1JqbXVNNEswVFk/view?usp=sharing
     
  15. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hello, to add coins, simply use this code:

    Code (csharp):
    1.  
    2. int ADDAMOUNT = 280; //280 to be added as you mentioned.
    3. PlayerPrefs.SetInt("Coins", PlayerPrefs.GetInt("Coins",0)+ADDAMOUNT);
    4.  
     
    Ultrapp likes this.
  16. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Thanks Soumi for help!
    Add the code in the file "Videos UnityScript.cs" I copied in the option where the video is full view..... but does not add the amount to the result.
    I can do ?, not add to 280 coins
    Please help again.......

    voidAdCallbackhandler (ShowResultresult)
    {
    switch(result)
    {
    caseShowResult.Finished:
    Debug.Log ("Ad Entregado. Entregando Monedas...");

    intADDAMOUNT = 280; //280tobeaddedasyoumentioned.
    PlayerPrefs.SetInt("Coins", PlayerPrefs.GetInt("Coins",0)+ADDAMOUNT);

    break;
    caseShowResult.Skipped:
    Debug.Log ("Ad Descartado. No damos nada...");
    break;
    caseShowResult.Failed:
    Debug.Log("Ad Fallo. No hay dinero!!!");
    break;
    }
    }



    "VideosUnityScript.cs"
     
  17. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The coins are getting added but the coins counter isn't getting refreshed so you should use the code below instead:

    Code (csharp):
    1.  
    2. int ADDAMOUNT = 280; //280 to be added as you mentioned.
    3. PlayerPrefs.SetInt("Coins", PlayerPrefs.GetInt("Coins",0)+ADDAMOUNT);
    4.  
    5. UIManager Mgr;
    6. Mgr = FindObjectOfType(typeof(UIManager)) as UIManager;
    7. Mgr.SetMenuScore();
    8.  
     
    Ultrapp likes this.
  18. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Yes!!!!...Thanks Suomi that works!!!

    Finally I ask the how to make a small message is displayed and a sound to inform the player award .... that and you're ready.

    I appreciate the help again!
     
  19. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This should work.

    Code (csharp):
    1.  
    2. int ADDAMOUNT = 280; //280 to be added as you mentioned.
    3. PlayerPrefs.SetInt("Coins", PlayerPrefs.GetInt("Coins",0)+ADDAMOUNT);
    4.  
    5. UIManager Mgr;
    6. PlayerMovement Controller;
    7. Mgr = FindObjectOfType(typeof(UIManager)) as UIManager;
    8. Controller = FindObjectOfType(typeof(PlayerMovement)) as PlayerMovement;
    9.  
    10. Mgr.SetMenuScore();
    11.  
    12. Mgr.MissionNotification.gameObject.SetActive(true);
    13. Controller.MissionMsg.text = "Your message here";
    14. Controller.MissionTimer = 3;
    15.  
    16. Controller.PlaySound(AUDIO_CLIP);
    17.  
    18.  
    19.  
     
    Ultrapp likes this.
  20. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Oooooh!!! .....Thanks....

    But still not working.


    -The message just says "Mission Notification" and not the text I added.
    -In Line sound "PlaySound (AudioScript.CoinSound);" displays an error:
    NullReferenceException: Object reference not set to an instance of an object
    VideosUnityScript.AdCallbackhandler (ShowResult result) (at Assets/2D Endless Runner Kit/Scripts/C#/VideosUnityScript.cs:86)
    UnityEngine.Advertisements.UnityAds.deliverCallback (ShowResult result) (at Assets/Standard Assets/UnityAds/Scripts/Advertisements/VideoAds/UnityAds.cs:228)
    UnityEngine.Advertisements.UnityAds.onVideoCompleted (System.String parameters) (at Assets/Standard Assets/UnityAds/Scripts/Advertisements/VideoAds/UnityAds.cs:304)
    UnityEngine.Advertisements.UnityAdsEditorPlaceholder.Hide () (at Assets/Standard Assets/UnityAds/Scripts/Advertisements/VideoAds/UnityAdsEditorPlaceholder.cs:80)
    UnityEngine.Advertisements.UnityAdsEditorPlaceholder.windowFunc (Int32 id) (at Assets/Standard Assets/UnityAds/Scripts/Advertisements/VideoAds/UnityAdsEditorPlaceholder.cs:63)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)



    I tried making some changes did not work, currently my date with changes and other things that I added code is well ....

    using UnityEngine;
    using System.Collections;
    using UnityEngine.Advertisements;
    using UnityEngine.UI;

    public class VideosUnityScript : MonoBehaviour {

    public Button botonVideo;
    public Text textoBotonVideo;
    public PlayerMovement Controller;


    //External scripts:
    [HideInInspector]
    public AudioManager AudioScript; //Music player script.
    [HideInInspector]
    public LevelManager Manager;
    [HideInInspector]
    public MissionsManager GoalManager;
    [HideInInspector]
    public UIManager Menu;

    //Mission message vars:
    [HideInInspector]
    public GUIContent MissionMsg= new GUIContent(); //Message
    [HideInInspector]
    public float MissionTimer = 0; //Timer

    [HideInInspector]
    public Transform MyTransform;



    void Awake() {
    if (Advertisement.isSupported) {
    //Advertisement.Initialize ("111111", true); //Modod prueba, utilizar el de abajo al momento de ir a produccion
    Advertisement.Initialize ("111111");
    } else {
    Debug.Log("Plataforma no soportada");
    }
    }

    public void MostrarBoton() {

    if(Advertisement.IsReady())
    textoBotonVideo.text = "Mostrar Ad";
    else
    textoBotonVideo.text = "Esperar...";
    botonVideo.gameObject.SetActive(true);
    }

    public void ShowAd(string zone = "")
    {

    if (string.Equals (zone, ""))
    zone = null;

    ShowOptions options = new ShowOptions ();
    options.resultCallback = AdCallbackhandler;

    if (Advertisement.isReady (zone))
    Advertisement.Show (zone, options);
    }

    void AdCallbackhandler (ShowResult result)
    {
    switch(result)
    {
    case ShowResult.Finished:
    Debug.Log ("Ad Entregado. Entregando Monedas...");

    int ADDAMOUNT = 280; //280 to be added as you mentioned.
    PlayerPrefs.SetInt("Coins", PlayerPrefs.GetInt("Coins",0)+ADDAMOUNT);

    UIManager Mgr;
    PlayerMovement Controller;
    Mgr = FindObjectOfType(typeof(UIManager)) as UIManager;
    Controller = FindObjectOfType(typeof(PlayerMovement)) as PlayerMovement;

    Mgr.SetMenuScore();

    Mgr.MissionNotification.gameObject.SetActive(true);
    MissionMsg.text = "280 Bananas Won !!!!";
    MissionTimer = 3;

    PlaySound(AudioScript.CoinSound);

    break;
    case ShowResult.Skipped:
    Debug.Log ("Ad Descartado. No damos nada...");
    break;
    case ShowResult.Failed:
    Debug.Log("Ad Fallo. No hay dinero!!!");
    break;
    }
    }


    public void PlaySound ( AudioClip Sound ){
    if(AudioScript.IsSoundON == true)
    {
    AudioScript.gameObject.GetComponent<AudioSource>().PlayOneShot(Sound);
    }
    }


    }
     
    Last edited: Nov 30, 2015
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Try this:

    Code (csharp):
    1.  
    2. int ADDAMOUNT = 280; //280 to be added as you mentioned.
    3. PlayerPrefs.SetInt("Coins", PlayerPrefs.GetInt("Coins",0)+ADDAMOUNT);
    4.  
    5. UIManager Mgr;
    6. PlayerMovement Controller;
    7. Mgr = FindObjectOfType(typeof(UIManager)) as UIManager;
    8. Controller = FindObjectOfType(typeof(PlayerMovement)) as PlayerMovement;
    9.  
    10. Mgr.SetMenuScore();
    11.  
    12. Mgr.MissionNotificationText.text = "Your message here";
    13. Controller.MissionTimer = 3;
    14. Mgr.MissionNotification.gameObject.SetActive(true);
    15.  
    16. Controller.PlaySound(AUDIO_CLIP);
    17.  
    For the audio clip error, you need to create an audio clip variable then change it with "AUDIO_CLIP" or if you want to use the coin sound effect from the audio manager then you can simply use this:

    Code (csharp):
    1.  
    2. Controller.PlaySound(Controller.AudioScript.CoinSound);
    3.  
     
  22. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Hi thanks for reply again!
    I can not make it work ...

    The message:
    The code "Controller.MissionTimer = 3;" does not work, error message "NullReferenceException: Object reference not set to an instance of an object".
    Writing the code as "MissionTimer = 3;" the message box and the text appears but not disappears without 3 seconds indicated (only disappears after playing and die).

    Sound:
    I created a variable and I tried to add a sound but does not allow it and a message "type mismatch" appears (it did not work mp3, wav) .... I tried creating the variable again and does not allow me drag any audio file.

    With the code "Controller.PlaySound(Controller.AudioScript.CoinSound);"..... appears the error "NullReferenceException: Object reference not set to an instance of an object
    VideosUnityScript.AdCallbackhandler (ShowResult result) (at Assets/2D Endless Runner Kit/Scripts/C#/VideosUnityScript.cs:88)" .....
    ..... the same error if I write the code in this manner "PlaySound(AudioScript.CoinSound);"

    Please Help again!!!..

    Add the new versión of my code!
    https://drive.google.com/file/d/0B8YNgQXSI8KIZTMtZ1lfMXZHUHc/view?usp=sharing
     
  23. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Sorry for the late reply, I haven't received the notification e-mail.

    It seems like the "PlayerMovement" script is missing? I've already using this code in a blank script with the 2D Endless Runner Kit and it works correctly. As for the audio clip variable, you should make it a public one so that it appears on the inspector to drag and drop the audio file in it.
     
    Ultrapp likes this.
  24. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Thanks for all SoumiDelRio!
    I think that the problem was caused by code that I added ....
    I finally did something else, I added the code to disable the message box when the main menu buttons (Shop, Play, Mission) were pressed and the message disappears with it .... it works out well!
    If possible I would also have made the change "BackgroundManager" to change the background and possibly enemies according to the selected player, would be a good extension of the game as it does "Shooty Skies".
    If it worked well for you Ads Unity button with the code that I shared, which got better after what could be included in the kit, while it is also considered an extra to buy a template point game.
     
  25. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The next update, which will probably be available in one and half week (Need to work on urgent updates for some of my other assets first), will include the option to have custom backgrounds, enemy waves and sound effects for each player.
    Glad the Unity Ads code finally worked for you.
     
    Ultrapp likes this.
  26. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Great, then I wait for the update ....
    Yeah, I finished and is awaiting approval in Apple Store to make it published .... thanks for everything!
     
  27. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    2D Endless Runner Kit v1.06 has been submitted, here's the update list:

    - Fixed a small bug in the mission notification message.
    - Added the option to have custom enemy waves for each character.
    - Added the option to have custom background layers for each character.
    - Added the option to have custom sound effects for each character.

    Would love to see your game when it's available, make sure you post the link in this thread!
     
    Ultrapp likes this.
  28. GB51

    GB51

    Joined:
    Nov 5, 2015
    Posts:
    31
    Nice to see the newest features in v1.06! Will the kit allow me to add another one or two additional background layers? Thanks!:)
     
  29. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    You can have as many background layers as you want.
     
  30. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    New promotional video for the 2D Endless Runner Kit!
     
    Ultrapp likes this.
  31. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    ______________________________________________
    How well I hope you upload in the asset store!
    There is a bug that occurs when using the power up is to destroy ..... when you destroy the floor several times disappears and not appears more .... So I found some time ago and forgot to say.
     
  32. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
  33. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thanks for reporting the bug, I will look into it.

    Looks great! Good luck with the game!
     
    Ultrapp likes this.
  34. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    2D Endless Runner Kit v1.06 is now available on the asset store!
     
    Ultrapp likes this.
  35. GB51

    GB51

    Joined:
    Nov 5, 2015
    Posts:
    31
    After updating and importing v1.06 into Unity 5.3 (which by the way I am truly grateful for :)), the Demo Game runs without the background(I'm only getting a black background). Is this a known issue or am I missing something?
     
  36. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    You have to check "Main BG" in the "BackgroundManager" if you wish to use that background as the main one (it means that if a character doesn't have a custom background, then each background layer that is marked as "Main BG" will be activated).
     
  37. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    NEW YEAR SALE: 50% OFF
    Before: $35.00, NOW: $17.50

    To celebrate the new year, 2D Endless Runner Kit is on sale! Get it now for 50% OFF!
    Note that the Game Kit Bundle is also on 50% OFF as well!
     
    Ultrapp likes this.
  38. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The new year sale is over! Thanks to everyone for purchasing the 2D Endless Runner Kit!
     
  39. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Currently working on a new update for this kit, it will mainly include a new method to spawn waves then hide them and re-use them when needed. This means better object pooling and better mobile performance.
     
    Ultrapp likes this.
  40. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Just submitted a new update which will mainly add object recycling for better performance on mobile devices, here's the update list:

    - Added object recycling for waves, particle effects (coins related) and background layers.
    - Code optimization for better performance on mobile devices.
    - Improved the way custom character background layers/waves are created.
    - Improved the level object movement for better performance.
    - Improved the player interaction with level objects for better performance.
     
    Ultrapp likes this.
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    2D Endless Runner Kit update is now live on the asset store: Better object recycling for better and smoother performance on mobile devices!
     
  42. Freeman1980

    Freeman1980

    Joined:
    Mar 17, 2014
    Posts:
    4
    Hi,

    the asset doesn't seem to be available anymore on the store. Will it come back soon?

    Regards
     
    JoRouss likes this.
  43. JoRouss

    JoRouss

    Joined:
    Apr 1, 2014
    Posts:
    53
    I just bought it and didn't have time to download the .unitypackage. Now it disappeared. What's happening?
     
  44. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I'm really sorry for this guys, I was hoping the asset store could resolve this issue soon before I post anything here. Here's what happened: http://forum.unity3d.com/threads/so-unity-decided-to-disable-my-asset.394109/
     
    JoRouss likes this.
  45. bill2432

    bill2432

    Joined:
    Oct 6, 2014
    Posts:
    8
    Hi Iam really happy that your problem with asset store is solved. I want to check a bug on the code. I try many deferents ways to fix the problem but i did not made it. So please check, when the player take the shield power up then if he hits the ground or an object with 2d collider then the object "break" disappear from the screen and as the game is running it does not create any other clone prefab. I download from store a new nulled version of the code and run it and again the same problem. I also try and older unity versions and still the same problem. I am running now the unity 5.3.4 but I also try and on 5.2 and again the same. Please try to run the code pick up a power up (shield) and see if you have the same problem.
     
    janeDoe9173 likes this.
  46. bill2432

    bill2432

    Joined:
    Oct 6, 2014
    Posts:
    8
    please try from the shop - upgrades take the headstart (single use) power up run the game activate it and in my case all the objects that the plane hit's as the power up is active dissapear from the screen and then the code can not regenarate the object from the clone prefab.
     
  47. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thank you for reporting this bug, I will look into and update the asset as soon as possible. It seems like it's something I forgot to change when I added the object pooling in the last update.
    Sorry for any inconvenience this has caused.
     
  48. v3n0mou5

    v3n0mou5

    Joined:
    Jan 8, 2014
    Posts:
    14
    Hey,

    First i want to thank you for this awesome asset. Its by far one of the best. I just have a quick question.

    Why does the Run and Jump movement not work.

    The error it gives me is:

    Object refrence not set to an instance of an object.

    Im pretty sure im messing it up but the code cannot seem to complete this:

    Code (CSharp):
    1. GroundCheck = transform.Find("GroundCheck");
    In the asset i downloaded, i do not find GroundCheck anywhere.

    Thanks in advance!
     
  49. bill2432

    bill2432

    Joined:
    Oct 6, 2014
    Posts:
    8
    Do not worry I just hope to fix it soon so I will upload my new game created with your amazing code to the google and iOS store. Keep the good job!
     
  50. janeDoe9173

    janeDoe9173

    Joined:
    Jul 20, 2014
    Posts:
    7
    I am having an issue, maybe someone can help. I have downloaded and imported the 2D Endless Runner
    Kit and when I push play on the demo scene I am instantly receiving a ton of errors reading, "
    IndexOutOfRangeException: Array index is out of range.
    UIManager.Update () (at Assets/2D Endless Runner Kit/Scripts/C#/UIManager.cs:457)
    Can someone tell me how to fix this?