Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Infinite Runner Starter Pack

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

  1. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive I'm adding new panels in the existing GUI made by you using UGUI. But when I add code for new panels in guiManager script, it doesn't show up in the Game's inspector where guiManager script is added. but when I just check the by clicking the guiManager script then it shows the fields I have added in the inspector.
    I have created a new settings panel. And created a new button on the Main panel in anchor right. I have also added the required code in gui click event receiver and gui manager but the gui manager script in Game is not showing me the new fields I have created so that I can add my new panel in it.
    Please help!
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    The GUIManager uses a custom editor script to allow you to switch between uGUI and NGUI. Because of this any fields that you add to GUIManager.cs you'll also need to add to Infinite Runner/Editor/Game/GUIManagerInspector.cs.
     
  3. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    hi
    any news when we can expect a unity 5 update? seeing as though its almost ready for release. dont want to start another game in unity 4.
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    The scripts are already compatible with Unity 5 :) We are planning on completely remaking the demo scene to be appropriate for Unity 5 but that will be completely on the art side of things.
     
  5. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    cool. would just be nice to have it all as it should be for someone new to it and learning it all. Right now everything's a mess so it makes it more difficult to get a hold of everything. If its all working perfect and you change something out and it stops working you know you've screwed up, right now its too hard to know because nothing works properly.

    hope that update will be coming soon.
     
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    This update that we're planning on doing is completely art-focused so it won't change the workflow at all. What is a mess right now? If something is confusing I can help to explain it but overall I like how it is structured. Recently I have been getting a more-than-normal amount of questions on how to align the objects so I do plan on adding a gizmo that will allow you to align things visually but that's pretty minor in the grand-scheme of things.
     
  7. AdnanNazir

    AdnanNazir

    Joined:
    Sep 8, 2014
    Posts:
    3
    Just Awesome kit to be used for any sort of infinite running.
    will buy soon.
    Seem's you are not less than God :)
    Bravo man,
    Great work. Adorable, Lovely <3
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    I appreciate it! (though I wouldn't go that far.. still flesh and bone according my recent injury ;)). It does help that we are lucky enough to be able to work on Unity assets fulltime.

    We have a lot planned with the Unity 5 version!
     
    Last edited: Feb 12, 2015
  9. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    Hi
    no i meant nothing works with this pack in unity 5. All the shaders, colliders everything is screwed up, try it for yourself. The player falls through everything and none of the shaders work. Please can this be sorted for unity 5, almost every other asset that i have bought is already updated ready for it.

    And my point is, if its already screwed up to begin with and you change something, its impossible to know if its you that has done something wrong or it is one of the glitches in unity 5/infinite runner pack, its supposed to make it easier not confuse things lol

    i think a lot of people will start with the demo scene and swap things out, cant do that if its not working.

    im not complaining about your pack i think its really great, just the fact it doesn't work in unity 5, which i'm sure everyone is going to be using now as its about to be released.
     
  10. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    hmm.. I'm not seeing the same thing -

    unity5.png

    There was one shader error dealing with a redefinition of unity_LightmapST but that can easily be fixed by just removing the line that is causing the error. For reference it is line 33 of Diffuse Cruve.shader:

    Code (csharp):
    1.  
    2. uniform half4 unity_LightmapST;
    3.  
    Once I deleted that line everything worked. There is no lightmapping but that makes sense because it is still using beast. I'll submit a new version that has this line fixed before Unity 5 is released.

    If you delete that line does everything work? I was actually kind of surprised you said that so much stuff was messed up because I know of at least one other person who is exclusively using Unity 5.
     
  11. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Oh Great, Thanks Man!
     
  12. AdnanNazir

    AdnanNazir

    Joined:
    Sep 8, 2014
    Posts:
    3
    Oooo Really Opsive!!!
    Don't tell me.
    You are injured . I am really worried my soul <3
    My prayers are with you.
    Move forward Hunk. I Just desperately want to see things coming from you .
    Congratulation and stay blessed :)
    and yeah u r lucky but more than talented and super skilled .
    don't feel I am buttering :p You knew it. you deserve praising :)
     
  13. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    hi its not 'just' the light-mapping, the player falls or goes through everything as well, walls staircase etc.
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Are you using Unity 5 RC1 and the latest Infinite Runner Starter Pack Pro? When I tested it I created a new project with RC1 and downloaded a fresh copy off of the Asset Store. The only error that I got was the shader error but once I removed that one line from the shader I didn't have any problems.
     
  15. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    ah ok it might be that! i need to update to unity5 rc1, didn't even notice a new version was out, but yes its latest version of runner pack pro from asset store. ill let you know, thanks.
     
  16. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    Hi
    yes that fixed most things. However the player still falls through stuff sometimes.
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Great to hear that it is working better. So the character falls through any ordinary platform? I just tested it and ran to a score of 25,000 without a problem.
     
  18. paskal007r

    paskal007r

    Joined:
    Sep 6, 2013
    Posts:
    66
    Hi, I've added moving objects to the scene, these object follow along the player's movement. But there is this strange behaviour: they now disappear when the "owner" track object (in which they were instantiated as obstacle) are getting cleaned up after the player passes over them. I need to somehow tell the appropriate manager that they need to be considered not as part of the object that originated them but the one they currently are in. Which data structures should I manage to change?
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    As you've seen, when a MovingObstacle spawns it registers itself with the PlatformObject so that MovingObject can be removed when the platform is removed and placed back in the pool. When the obstacle is moving in the opposite direction of the player this works well. I'm guessing your obstacle is moving with the player at the same speed or faster? In that case you'll need to do:

    In CollidableObject.cs, change platformParent from a private variable to a protected variable:
    Code (csharp):
    1.  
    2. protected PlatformObject platformParent;
    3.  
    Unsubscribe from the platform deactivation. This should be done within MovingObstacleObject.Orient, after the base method is called:

    Code (csharp):
    1.  
    2.   base.Orient(parent, position, rotation);
    3.   platformParent.OnPlatformDeactivation -= CollidableDeactivation; // <-- here
    4.  
    Now the moving obstacle won't be removed when the platform is removed but you'll need another way to remove it. Within the Update loop you could do a raycast and add/remove itself from each platform that it is over but if you have a MovingObstacle that is moving with the player this doesn't make sense because it will always be ahead of the player so the platform that it is over will never be removed. My recommendation would be to just deactivate it when it is n units ahead of the player. Something such as:

    Code (csharp):
    1.  
    2.   float squareMagnitude = Vector3.SqrMagnitude(thisTransform.position - playerTransform.position);
    3.   if (squareMagnitude > n) {
    4.      DeactivateCollidable();
    5.      return;
    6.    }
    7.  
    You would add this within the Update loop. I am using the square magnitude because that is faster than taking the magnitude.
     
    paskal007r likes this.
  20. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive, How does the static data works and where does it stores all the data of the game?
    also i need to flush the save game data like missions state and coins.
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Everything is saved with PlayerPrefs. You can clear the data with PlayerPrefs.DeleteAll(). Just add the DeleteAll method to any executing code, such as within GameManager.Start.
     
  22. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
  23. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive
    I added some new collectables in the game and i want to use them to unlock character and to skip missions.
    also i need help regarding this code (MissionManager.cs)
    Code (CSharp):
    1.  private MissionType CheckForCompletedMissions(bool inGame)
    2.         {
    3.             for (int i = 0; i < activeMissions.Length; ++i) {
    4.                 switch (activeMissions[i]) {
    5.                    case MissionType.NoviceRunner:
    6.                    case MissionType.CompetentRunner:
    7.                    case MissionType.ExpertRunner:
    8.                         if (dataManager.GetScore(false) >= dataManager.GetMissionGoal(activeMissions[i])) {
    9.  
    10.                             MissionType completeMission = activeMissions[i];
    11.                         A=true;
    12.                         Debug.Log("a--true");
    13.                             MissionComplete(activeMissions[i]);
    14.                             return completeMission;
    15.                         }
    16.                         break;
    17.                     case MissionType.NoviceCoinCollector:
    18.                     case MissionType.CompetentCoinCollector:
    19.                     case MissionType.ExpertCoinCollector:
    20.                         if (dataManager.GetLevelCoins(true) >= dataManager.GetMissionGoal(activeMissions[i])) {
    21.                             MissionType completeMission = activeMissions[i];
    22.                         B=true;
    23.                             MissionComplete(activeMissions[i]);
    24.                         Debug.Log("B--true");
    25.                             return completeMission;
    26.                         }
    27.                         break;
    28.                     case MissionType.NovicePlayCount:
    29.                     case MissionType.CompetentPlayCount:
    30.                     case MissionType.ExpertPlayCount:
    31.                         // play count doesn't get incremented until after CheckForCompletedMissions is called
    32.                         if (dataManager.GetPlayCount() + (inGame ? 0 : 1) >= dataManager.GetMissionGoal(activeMissions[i])) {
    33.                             MissionType completeMission = activeMissions[i];
    34.                         C=true;
    35.                         Debug.Log("c--true");
    36.                             MissionComplete(activeMissions[i]);
    37.                             return completeMission;
    38.                         }
    39.                         break;
    40.                 }
    41.             }
    42.             return MissionType.None;
    43.         }
    44.  
    45.         private void MissionComplete(MissionType missionType)
    46.         {
    47.         if (A && B && C) {
    48.  
    49.                                 if (((int)missionType - 3) % 4 != 0) { // don't increment if the player has already reached the max
    50.                                         int missionSet = (int)missionType / 4;
    51.                                         activeMissions [missionSet] = missionType + 1;
    52.                                         scoreMultiplier += scoreMultiplierIncrement;
    53.                                         PlayerPrefs.SetInt (string.Format ("Mission{0}", missionSet), (int)activeMissions [missionSet]);
    54.                                 }
    55.  
    56.                                 if (OnMissionComplete != null) {
    57.                                         OnMissionComplete (missionType);
    58.                                 }
    59.                         }
    60.         }
    i actually want to update mission when all 3 mission will be completed and when each mission complete debug.log shows a--true, b--true, or c--true respectively. but it never shows b--true. but when we comment "if (A && B && C) " it then only it shows b--true. pls help
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    I'm not completely following but it looks like B will only be true when you have unlocked any level of the coin collection mission. Can you explain your goal in more detail? I can probably then tell you a better way to handle it.
     
  25. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    actually i am facing two problems
    the first one is, i added new collectables in the game and i want to use them to unlock characters just like subway serfer. they are not they one just add a trigger for count on them and storing the values through PlayerPrefs.
    for example if i have 3 locked character and 2 of them will be unlocked by coins but the third one with collectable(like mask).
    The second thing is i want mission change only when all three mission of a set are done.
    that why i put a, b, c bool variable.which don't allow MissionComplete() to execute untill all values are not true that means all mission of that set should be over. here mission set is like: run 50 m, collect 50 coins, play 5 games
    then if player complete 2 mission and not the third one the next mission set will not be appear.just like in most of the games. and thanks for the help
     
  26. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    I would start by looking at the GUIManager.PurchaseStoreItem method. You'll need to add some logic to the DataManager for it to recognize what a mask is. You could actually follow a similar structure as what I did when I added the secondary coins (the diamonds). This is a little bit more involved so I don't have any specific code changes but it shouldn't be too hard to add once you take a look at those classes. Or if you don't need revivals you could instead keep the DataManager the same and instead use the secondary coin to unlock your third character. This would significantly reduce the number of code changes.

    So you basically only want one type of mission active at a time? The easiest way would probably be to just have one element within the activeMissions array instead of all three. This way it will only check against that one mission type. Within MissionComplete you would then move onto the next mission type after the previous mission type has been maxed out:

    Code (csharp):
    1.  
    2.   if (((int)missionType - 3) % 4 != 0) { // don't increment if the player has already reached the max
    3.     int missionSet = (int)missionType / 4;
    4.     activeMissions[missionSet] = missionType + 1;
    5.     scoreMultiplier += scoreMultiplierIncrement;
    6.     PlayerPrefs.SetInt(string.Format("Mission{0}", missionSet), (int)activeMissions[missionSet]);
    7.   } else {
    8.      // Switch missions
    9.   }
    10.  
     
  27. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive,
    How do I pause the game when an android device key [see attachment, marked in yellow] is pressed while we are running?
    Untitled.png
     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    That's actually a good question. You should probably as this in the Android forum - I just did a quick search but didn't come up with anything other than paid Asset Store assets. I know you can get the back button by checking the escape key but I don't know about the others.

    You can then pause the game with GameManager.instnace.PauseGame(paused). Keep in mind that this will just pause the game and not show the pause screen GUI. If you look at the pause button within the game you'll see that it has a couple of components that play an animation when the button is pressed. You'll need to do the same thing in this case. The end screen has a good example of this - take a look at GUIManager.ShowGUI and you'll see that it manually starts the animation: endGamePlayAnimation.Play(endGamePlayAnimationName);
     
  29. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    779
    Does OnApplicationPause not work? I believe if Unity loses focus you should receive that callback, so you could then call the PauseGame method that the kit provides.
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    I actually initially thought about that but since the infinite runner implements OnApplicationPause and the question was asked how to handle it I then thought that OnApplicationPause actually doesn't get called in that situation... Maybe I was over thinking it.

    Try placing a breakpoint or Debug.Log within GameManager.OnApplicationPause to see if it ever gets hit.
     
  31. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, Thanks for the reply.
    OnApplicationPause works fine when the home key is pressed on Android. But for the other keys it is not calling. Let me surf through android forums.
     
  32. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    779
    opsive likes this.
  33. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    mimminito likes this.
  34. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    779
    No worries! Now I wish I had time to put this kit to use rather than just reading this thread and seeing others great creations... :(
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Thanks @mimminito! I'll add OnApplicationFocus to the next version.
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    It's looking like there is a good chance that Unity 5 will be released next week at GDC and the Infinite Runner Starter Pack Pro code is ready to go. I have been working on adding a curve to the standard shader and things are going well. We should be able to have a new version released before Unity 5 ships. We are still planning on completely remaking the art assets for a Unity 5 scene and that will not be ready before Unity 5 ships but that's more for demo purposes anyway.

    Here's a preview of the standard shader with the curve properties:

    shader.PNG
     
    mimminito likes this.
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Version 1.6.2 of the Infinite Runner Starter Pack Pro is now out on the store. This update sets the minimum Unity version to 4.3 and adds a curved version of the Unity 5 Standard shader. There are some other minor changes and you can see the full release notes here.
     
  38. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    Hi @opsive I want to make the power up bar by using unity Ui slider, please help me with this.
     
  39. abhishek1191

    abhishek1191

    Joined:
    Apr 13, 2014
    Posts:
    47
    one more thing how i can add an image or panel behind the player(character transform) in store panel. when i try to do so by adding a panel behind it, it hides the character in the menu.
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    The current version works by setting the cutoff value of a material within GUIManager:UpdatePowerUpProgress. You can just change it so instead of a cutoff value you are assigning a value to your slide:

    Code (csharp):
    1.  
    2. mySlider.value = cutoff;
    3.  
    The GUI uses the Screen Space - Overlay mode which will render all GUI elements above the real world objects. You'll need to switch modes in order to get the character prefab to render in front of the GUI elements. World Space will probably be the easiest but it is still going to be some work lining everything up correctly.
     
  41. mooneyegames

    mooneyegames

    Joined:
    Mar 25, 2015
    Posts:
    3
    Hi Opsive,
    Thanks for the excellent support you have given us in developing our first game WataWaka. The Beta Release has been launched on the App store. This Starter Kit helped us a lot in the development of our game.
    Please check out the trailer

    Here is the App store link
    **Beta release only available on Australia, Canada and India. Will be releasing world wide soon.
     
    Last edited: Mar 25, 2015
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Congratulations! It looks like WataWaka has a ton of content. I like that you can do more than just run. Be sure to post again when you are out of beta and released worldwide!
     
  43. mooneyegames

    mooneyegames

    Joined:
    Mar 25, 2015
    Posts:
    3
    Thanks Opsive, Will let you know about the release soon.
     
  44. mooneyegames

    mooneyegames

    Joined:
    Mar 25, 2015
    Posts:
    3
  45. Abelabumba

    Abelabumba

    Joined:
    Jan 14, 2015
    Posts:
    45
    Is it possible to change the touch input/controls? Basically I want to adjust "run" speed via script / my own variable and use another gesture than simple swipe left/right for moving left/right.
     
    Last edited: Mar 30, 2015
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    Sure, you should just need to modify the InputController component to add another gesture. Since it is the objects around the player rather than the player itself doing the moving, you can adjust the run speed via your own script by modifying the following line within PlayerController:
    Code (csharp):
    1.  
    2. infiniteObjectGenerator.MoveObjects(forwardSpeed);
    3.  
    forwardSpeed is the variable that you can change to your own. Free horizontal movement is included, it is on the InputController rather than the PlayerController
     
  47. Abelabumba

    Abelabumba

    Joined:
    Jan 14, 2015
    Posts:
    45
    Ok great, you have a new customer :)
    The horizontal movement, can I make the movement in tiny steps? Imagine the player has to hammer the left button 50 times to move from the rightmost to the leftmost part of the track? I guess I'll see for myself soon haha
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    I appreciate it :)

    For the free horizontal movement change, on the desktop you actually shouldn't need to make any changes as you can just adjust the freeHorizontalMovementDelta value to a very small number and it'll achieve the effect that you are going for. On mobile platforms it uses the touch delta but you can change it so it uses the same parameter as on the desktop. For reference, here's the line that gets called on mobile:

    Code (csharp):
    1.  
    2. playerController.MoveHorizontally(diff.x);
    3.  
    Where diff is "touch.position - touchStartPosition"
     
  49. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    218
    I am a buyer of this kit. Recently.. I am enjoying Spider-Man Unlimited


    This Game, Enemy has appeared in front of the Player
    And the Enemy fly here and there

    I hope to add this feature.. Can I expect this feature? please~
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,677
    I scrubbed through the video and found a couple of points where there is an enemy in front of the player but I didn't see the flying part - can you post the time that it occurs? The enemies that are standing in front of the player can already be accomplished by using the ObstacleObject component. You'll probably want to subclass this component to add more functionality but in this case the enemies can be considered an obstacle. I haven't seen it, but the flying can probably be accomplished by playing an animation when the player gets close to the enemy.

    In a month or two we will be starting on a version specific to Unity 5 that will use a lot of its new features. I can't wait to post more about it when we get there.