Search Unity

Infinite Runner Starter Pack

Discussion in 'Assets and Asset Store' started by opsive, May 23, 2013.

  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The video is a little out of date on some aspects but the GUI part should mostly be the same. The corresponding text documentation is always up to date. I will be updating the "Using Your Own Assets" video as soon as 1.6 is released.

    With that said, what do you mean by character panel? At what time in the video am I talking about it?
     
  2. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    Hi ,

    im using , unity 4.3.4 and 1.5.2 , in ngui when i pause the game and go to main menu , the player animation is not idle , its playng the running animation , thats the same running animation when clicking the missions ,store , and stats

    and if i go to play > pause > main menu > store > back : the magnet power up is active


    the demo scene ngui player animations are working fine . am i missing somthing?


    please help me
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I just tried that sequence and everything worked fine. I remember fixing something related to that so I would go ahead and update to version 1.5.4 of the starter pack.
     
  4. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    i updated it and its the same , does it related to unity version as well? should i update to 4.5 ? but the demo scene is working fine on this , the problem is with my scene , i just copied the gui from the main scene .still its not working well .
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The unity version should not matter. Since the demo scene works well, that means that the code is fine. There isn't anything within the scene that deals with the coin magnet trigger so it must be related to your character. Make sure the Coin Magnet Trigger field is referencing the correct object within your character prefab.
     
  6. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    thanks opsive ,
    one more problem , when i go to

    play > pause > main menu > and if i click missions or store or stats , the character is playing the run animation , i tried the demo character (Mecanim) as well , its the same , again working good in demo ,

    im using 1.5.4 now.
    i need to play idle animation insted of run animation. where can i check for the problem?
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I have since changed my GUIManager file but take a look at GUIManager:refreshStoreItem. At the end of that method is the following:
    Code (csharp):
    1.  
    2.   if (playerAnimation.useMecanim) {
    3.   storeItemPreview.GetComponent<Animator>().enabled = true;
    4.   } else {
    5.   storeItemPreview.animation.enabled = true;
    6.   playerAnimation.Idle();
    7.   }
    8.  
    This part is what plays the idle animation
     
  8. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    just checked the code is fine and

    its the same result in demo scene as well ,
    if im using Mecanim
    1st time it plays idle animation but

    play > pause > main menu >store , or missions , or stats ,

    or use the mecanim as the 1st character and

    go to store

    its showing run animation on gui

    and same run animation on startup aswell when selecting another mecanim character from store , it needs to be idle animaion ?

    please have a look ?
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I just switched to the mecanim character and did the following:

    1. go to store -> the idle animation plays
    2. back to main menu
    3. play game
    4. pause
    5. go to main menu
    6. go to store -> the idle animation still plays

    You said that it exists in the demo scene as well - did I do the wrong sequence of steps?
     
  10. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    could you try this one , (i tried this in a new fresh project with just the demo scene)

    use both the characters as Mecanim , dont use the legacy character ,

    go to store , and see ,its playing run character .

    if not hit play and go to store , it should play runnning animation ,

    or am i doing somthing wrong?
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I was originally testing it with version 1.6 in my main infinite runner project. When I tested it with a freshly imported version from the Asset Store I see the same thing you do. The problem deals with the animator controller. It isn't making a transition to the idle state. Please send me a PM or email with your invoice number and I'll send you the new controller.
     
  12. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    PM sent.
     
  13. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive I want to decrease the delay between jumps..I cant find the "RepeatedJumpDelay" Field in the player controller. I am using the latest version of the starter pack. Please help!
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I just imported the latest version from the Asset Store and that field is in the upper-middle of the Player Controller:
    jump delay.PNG
     
  15. reiannd

    reiannd

    Joined:
    Aug 11, 2014
    Posts:
    7
    hey @opsive . i recently downloaded this pack and it's great but I'm having many problems. I want to import my downloaded character asset and the free animations of mecanim to this pack. but im having troubles. the character is not moving. the character is having the controls but it has no slide and the character is just standing not making any animations.i uploaded a file please help me to maximize this pack :) thank you!
     

    Attached Files:

  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    What animator controller are you using? If you are using your own animations you need to make sure you switch them out within the existing CharacterController. If you are using a completely separate controller you'll need to make sure you have similar parameters setup. Besides that, did you set the forward speeds on the player controller? Also, are you getting any errors?
     
  17. reiannd

    reiannd

    Joined:
    Aug 11, 2014
    Posts:
    7
    @opsive thanky you for your answer. i am using these free character assets of unity called cartoon boy and girl i gave a screenshot. and i am having a continous error. i copy the components of your character and paste it to this character assets. its playing idle but when i start the game it is not running but can jump only on the same position. please help :( thank you!
     

    Attached Files:

  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Can you post the very first null reference? Those null references are repeating so they may not be the initial cause of the issue. Regardless, here's what is causing it:

    PlayerController.LateUpdate NullReference: It can't find the GameManager reference. Do you have a GameManager within the scene?

    PlayerANimation.setRunSpeed: It is trying to access an element in the animation array that is out of bounds. If you are using mecanim it shouldn't be doing this. Is the "Use Mecanim" option selected on the PlayerAnimation component?
     
  19. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    i am testing this in iPad , and iPhone its all working great with great fps but , i just export this in samsung s3 , tab the fps is very low and the scene getting struck in the middle , should i follow any specific android build setting?
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The easiest way to increase FPS is to adjust the quality settings. You should setup different quality settings based on the device. Besides that, the big things are to make sure you are using a texture atlas and are keeping the number of transparent objects to a minimum.
     
    jathoo likes this.
  21. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    Hey, I have a question about this asset. Is there a way to change it so I can jump while sliding and slide while jumping? The way subway surfers work. Right now, While I'm jumping/sliding, I have to wait until I'm back to running to jump/slide.

    I also noticed that you don't speed up as you go. Is there a way to make it so you start kinda slow and over time reach max speed?
     
    Last edited: Aug 13, 2014
    basilmon92 and jathoo like this.
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    For the jump, the code that is preventing that is on line 574 of PlayerController.cs:
    Code (csharp):
    1.   if (jumpHeight > 0 && !inAir() && !isSliding && !abovePlatform(false) && (fromTrigger || Time.time - jumpLandTime > repeatedJumpDelay)) {
    I would change this to:
    Code (csharp):
    1.  
    2.   if (jumpHeight > 0 && !inAir() && !abovePlatform(false) && (fromTrigger || Time.time - jumpLandTime > repeatedJumpDelay)) {
    3.     if (isSliding) {
    4.       stopSlide(true);
    5.     }
    6.  
    If you are using mecanim you'll need to add transitions from the slide state to the jump state to allow the animation to play correctly. There is similar code for the slide:
    Code (csharp):
    1.  
    2. if (slideDuration > 0 && !inAir() && !isSliding && !abovePlatform(false)) {
    3.  
    Remove the !inAir to start a slide. With this one you have to be more careful because the player could be in the air when it needs to start a slide. What you'll probably want to do is change the update loop so there is a heavier gravity when a slide should start but the character is currently in the air which will push the character down faster. You will also need to make the mecanim state transition changes as well for the slide if you are using mecanim.

    It actually does speed up but it is subtle. On the PlayerController there is the "Forward Speeds" field which lets you set different speeds for different distances.
     
    basilmon92 likes this.
  23. harschell

    harschell

    Joined:
    Sep 20, 2012
    Posts:
    19
    Hi @opsive
    I am working on your starter pack pro for prev three-four months...
    It doing well... I've five different levels
    ( 1st Level consist: wide number of platforms and respective scenes with all type of possible Obstacles, it uses section transition as variation 1 to variation 2 to variation 3
    2nd Level consist: wide number of City platforms and respective scenes with all type of possible Obstacles, it uses section transition as variation 1 to variation 2 to variation 3 ... etc )

    We are basically doing this by usning asset bundle (DLC). We are trying to achive something like smooth transitioning between those two levels while game is running in transition scenes as same as done in Temple Run OZ

    I've successfully done downloading new level and assigning all objects viz, platforms, scenes obstacles, etc to infine object generator object.

    But this is where we are facing problem as when i assign the 2nd level platforms, scenes... etc after assingning them I got null references as the variables, objectpools, appearencerules.. etc initialized in init function of InfiniteObjectManager.
    This resulting in spwaing nothing at all.
    So please tell me how should i re-initialize all those varibales or Hows should I proceeed further, so that this will work as smooths as it was before.
     
  24. reiannd

    reiannd

    Joined:
    Aug 11, 2014
    Posts:
    7
    hey, this is the initial null references. i dont have game manager in the scene and im not using mecanim, :(
     

    Attached Files:

  25. reiannd

    reiannd

    Joined:
    Aug 11, 2014
    Posts:
    7
    hey sir. i just bought this kit. can you please help me on how to change the character? using my downloaded character model with animation,
     
  26. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @harschell -

    What are the specific errors that you are getting? Once the infinite object arrays are formed in the Infinite Object Generator you should only need to call InfiniteObjectGenerator:init in order to setup the pooling, appearance rules, etc.

    @reiannd -
    I am confused. You said that you don't have a Game Manager in your scene and you're not using mecanim. Does the characters that you downloaded include animations? Also, in a previous post you mentioned mecanim. The Game Manager needs to exist in the scene. This Game Manager should be attached to the "Game" GameObject in the scene, which you shouldn't have to modify in order to change characters.

    The very first error, within PlayerAnimation.OnEnable, points to you not having a GameManager. Make sure that component exists in the scene.

    In terms of a tutorial, take a look at this video. It is a little dated and I plan on making a new one as soon as 1.6 is released but until then the text documentation is always up to date.
     
  27. reiannd

    reiannd

    Joined:
    Aug 11, 2014
    Posts:
    7
    @opsive yes sir. im not using the mecanim anymore :) and now but its only running in place. yes i downloaded the character with its animations. and sorry. yes i have the game manager attached. this is still the starter pack pro. i did not change anything. i only change the character. i am running unity 4.1.2. please help. sorry for the confusion.
     
  28. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive I have attached a moving obstacle with the platform, the platform spawns correctly but the behaviour and position of the moving obstacle is random I mean the moving obstacle sometime moves and sometimes don't and also changes the position itself. You can test it by attaching the cannonball with the inside straight platform and restart the game for a few times. Please help!
     
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @reiannd -

    Are you still getting the same error? Since it doesn't sound like you are too far, I think that the easiest would be to just start from scratch and make sure the game is working with the character provided. From there you should follow the documentation/video (linked to in my last post) on changing out your character.

    This does give me the idea to make a wizard for setting up your character. I will work on that today. If you want it before version 1.6 is released send me a PM/email with your invoice number.

    @abhishek1191 -

    The moving obstacles activate as soon as they are placed on the platform. If you add them to the inside straight platform they will see that they are within distance of the player and start moving right away.

    The fix for this is pretty simple, just check to make sure the game is running at the very start of the Update loop in MovingObstacleObject:

    Code (csharp):
    1.  
    2.   if (!GameManager.instance.isGameActive())
    3.    return;
    4.  
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Here's a screenshot of the new Character Creation Wizard:

    CharacterWizard.PNG

    This wizard basically does all of the steps listed in the documentation. It will be available in version 1.6. It should work with the current version though so if you want it now just send me a email or PM with your invoice number (@reiannd)
     
  31. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    @opsive thanks for the reply but its still not working. I was trying to attach a cannonball (moving obstacle) and a chair(normal obstacle)inside the "inside straight" platform . first it seems like working fine but as the game progress moving obstacle's position changed and only normal obstacle appear on platform. plz help
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @abhishek1191 -

    Can you tell me how to reproduce it from a new project with version 1.5.4 freshly imported? When I tried a few days ago the cannonballs were positioned correctly after I made the change to prevent them from moving when the game wasn't started.
     
  33. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    @opsive. Hi, thanks for reply. Below are the steps I performed.

    Step 1. Put Inside straight,cannon ball and chair in the hierarchy, then make cannon ball and chair children of Inside Straight. And then decrease the "Start Move Squared Distance" to 150 or 200. Then Apply.
    Step2. Turn on the God Mode. The press the play button.

    I did these steps and it worked fine for the first platforms but after that only chair spawns correctly but the cannon balls spawns only a few times and that too with different positions.
    **Note: I am using version 1.5.3

    And please let me know when you are launching the version 1.6 of the starter pack. Eagerly waiting.
     
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Ah, you are parenting the platform to the cannonball and that's what is causing the issue. In order for the Collidable Object to be positioned correctly InfiniteObject : orient needs to be called and that is never called if the object is not managed by the Infinite Object Manager. My suggestion would be to not use the MovingObstacleObject component and instead just script your own. You can use a lot of the same logic from the MovingObstacleObject:Update loop, just within OnEnable set the position back to the starting position if it has already been initialized. Sort of like:

    Code (csharp):
    1.  
    2. private Vector3 startPosition;
    3. private Quaternion startRotation;
    4. private bool initialized = false;
    5. ...
    6. public void Start()
    7. {
    8.   startPosition = transform.position;
    9.   startRotation =transform.rotation
    10.   initialized = true;
    11. }
    12.  
    13. public void OnEnable()
    14. {
    15.   if (initialized) {
    16.     transform.position = startPosition;
    17.     transform.rotation = startRotation;
    18.   }
    19. }
    20.  
    You should of course cache the transform reference as well but this is just the general idea.


    In terms of 1.6, I have all of the new features coded and just working on the art for the demo scene. This version is a huge change in terms of the scripts. I dropped support for Unity 3, added namespaces, used standard C# method naming conventions (SomeMethod vs someMethod, my background is in C++ so some habits take awhile to change), and made more use of events. This will help future proof it for Unity 5 and clean some of the code up. There are still some things that I'd like to do but I figured that this is a big enough change for now. It will probably be easier to take your code changes and integrate it into version 1.6 rather then the other way around. Luckily this does not affect the scene at all.

    I am waiting to see the Unite keynote in order to determine when to release 1.6. I'd like to include uGUI support as well so if Unity 4.6 is very close to release I'll just hold off on releasing the new starter pack version until Unity 4.6 is released. I have beta access so I can start working on uGUI anytime but I haven't wanted to yet because Unity 4.6 is still in beta.
     
  35. KalaK

    KalaK

    Joined:
    Jul 3, 2013
    Posts:
    12
    I have no experience with Unity platform, so I ask some "stupid" questions :rolleyes:
    Can the character be replaced with other 3D characters from the Asset Store ?
    Just to be sure before I purchase :)
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    No worries :)

    Yes, you replace the character with another character from the Asset Store. The starter pack supports both legacy and mecanim animation. After you purchase it send me an email or PM with your invoice number and I'll send you a script which will dramatically speed up the process of creating a character (it basically follows these steps).

    Also, if you are completely new to Unity I first recommend you take a look at the Project Stealth tutorial. The starter pack assumes you have some Unity experience so these tutorials will give a good overview on how Unity works.
     
    KalaK likes this.
  37. KalaK

    KalaK

    Joined:
    Jul 3, 2013
    Posts:
    12
    Thanks for the quick answer !
     
  38. KalaK

    KalaK

    Joined:
    Jul 3, 2013
    Posts:
    12
    Is it Unity3D Free or Pro version I should use ?
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    You can use either, there are no pro features used. Also, I edited my previous post so I just want to make sure you saw this addition:

     
  40. KalaK

    KalaK

    Joined:
    Jul 3, 2013
    Posts:
    12
    Thanks, and yes I saw your notice to the tutorial :)
     
  41. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive Thanks for the reply. I understand that you want to release version 1.6 after unity 4.6 is released but can I get an earlier version of the starter pack 1.6?
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I will actually be releasing version 1.6 within the next couple of days. I decided to hold off of the uGUI update since we don't know how long 4.6 will be in beta for and I'll just add uGUI support in a bugfix release.
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Version 1.6 has been released! This release contains many new features and bug fixes. For the complete list take a look at this post. Some highlights include:

    Added a Secondary Coin
    Diamond2.PNG

    Added Revivals (can be purchased with the secondary coin)
    Revival.PNG

    Added Crossroads
    Crossroads.PNG

    In Game Mission Complete GUI Notification
    Missions.PNG

    New Appearance Rule
    That forces an object to spawn after another object
    ProbabilityAdj.PNG

    Note: This update includes a lot of C# standardizations such as namespaces and starting method names with a capital letter. As such, every single script was changed in some way and it will probably be easier to merge your additional code to this version rather than trying to merge this version with your code. We decided to do these updates now because we dropped support for Unity 3.5.7 and want to prepare for Unity 5 support.
     
    Last edited: Aug 24, 2014
  44. Sinhabros

    Sinhabros

    Joined:
    Aug 3, 2013
    Posts:
    15
    Amazing!
     
  45. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    hi opsive , i enabled the game center in itunesconnect and added a leaderboard , the game is showing the Game Center welcome banner but the "high score " (the one i set up on itunesleaderboard not showing up on my Game Center . ? can i have a quick steps to implement it? thanks
     
  46. humayoun

    humayoun

    Joined:
    Aug 25, 2014
    Posts:
    1
    Hi Opsive, I am really interested in buying your infinite runner pack, but i am confused in choosing whether I should buy the pro pack or the standard pack. Is there any possibility that i can first choose the standard pack and than upgrade to pro pack by paying the difference, e.g. i first buy the standard pack for $25 and pay another $30 for the pro pack if feel like having the pro one??
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @jathoo -

    It has been awhile since i setup GameCenter but I remember that it was a pain to setup. This was in the early days though so hopefully it has gotten better. Have you read this guide on setting up the leader board? From the infinite runner side, all you should need to do is set the bundle identifier. When a new high score is achieved SocialManager:RecordScore is called and then that uses Unity's Social API to report the score. You should receive a statement in the log stating whether or not the score was reported successfully. Have you gotten that far?

    @humayoun -

    Thanks for taking a look at the starter pack. The standard version is really out of date now and to be honest we will be discontinuing it in the future. But if you still want to purchase it then yes, we can help upgrade you to the pro version. That upgrade will need to be done via PayPal though since there is no way to do this on the Asset Store. We have a system in place though so if you purchase from PayPal you'll still get the updates and an email will notify you when the new version is out.
     
  48. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    yap ,i did all the steps in the guide and it asked for a leadeboard id , should it be from the pack or a random value ? i received the log before and set the bundle identifier. and im not receiving the score report log now
     
  49. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    You probably aren't receiving the score anymore because it is no longer a high score. The high score is stored in the PlayerPrefs so you can remove it with PlayerPrefs.DeleteAll(). In terms of the leaderboard ID, it shouldn't be from the pack or random. It should be whatever you assigned within iTunes Connect. Here's the scripting reference for reporting the score, though it doesn't give too much more info: http://docs.unity3d.com/ScriptReference/Social.ReportScore.html
     
  50. jathoo

    jathoo

    Joined:
    Feb 11, 2013
    Posts:
    29
    thank you , i just got 1 leaderboard and i wanted to submit highscore to the gamecenter , so should i use that code in the recordscore function ?

    Social.ReportScore (score, leaderboardID, success => {
    Debug.Log(success ? "Reported score successfully" : "Failed to report score");
    });

    but , Social.ReportScore is there with ,score and bundleidentifier parameters ?