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

Infinite Runner Starter Pack

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

  1. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, Sorry for that package not opening in your editor. Here it opens well on unity version 4.2.0. Do I need to upgrade my unity to get this startup issue solved? And i am completely updated to v1.4.1.
     
    Last edited: Dec 5, 2013
  2. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Yes I have completely updated to the recent version. Also I tried upgrading unity 3d but nothing happened. I will send you the package in zip, I think this will open in your editor.

    Thanks
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Normally if you open a Unity package with the latest version of Unity then it will work regardless of which version the package was made with. In any case, I got your zip and was able to reproduce the issue. The problem is that the infinite object generator was thinking that the center scene objects were located to the left or right. It is a quick fix. In InfiniteObjectGenerator.cs, change

    Code (csharp):
    1.  
    2.                 // determine the direction the object is facing based off of the y angle
    3.                 float yAngle = parentObject.eulerAngles.y;
    4.                 if (yAngle > 360 || yAngle < 0) {
    5.                     yAngle = yAngle % 360;
    6.                 }
    7.  
    8.                 if (yAngle > 269) {
    9.                     location = ObjectLocation.Left;
    10.                 } else if (yAngle > 89) {
    11.                     location = ObjectLocation.Right;
    12.                 } else {
    13.                     location = ObjectLocation.Center;
    14.                 }
    15.  
    to

    Code (csharp):
    1.  
    2.                 // determine the direction the object is facing based off of the x position. This works because all center platforms start the game at Vector3.zero.
    3.                 float xPosition = topObject.transform.position.x;
    4.                 if (xPosition < -1) {
    5.                     location = ObjectLocation.Left;
    6.                 } else if (xPosition > 1) {
    7.                     location = ObjectLocation.Right;
    8.                 } else {
    9.                     location = ObjectLocation.Center;
    10.                 }
    11.  
    This is around line 115.

    Edit: I thought some more about this solution and it won't work in every situation. It will work for the project that you sent me though. I have since fixed it for a more general solution that will be in version 1.4.2 (which I plan on submitting any day now)
     
    Last edited: Dec 6, 2013
  4. dail

    dail

    Joined:
    Dec 5, 2013
    Posts:
    10
    Opsive Hi, how to position the camera so that it faces toward the character?
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Hi dail,

    If you want to change the position of the camera on the main menu all you have to do is move the camera within the Unity editor - the starter pack won't mess with the starting position. If you are talking about the in game position, that (and the rotation) can be modified from the Camera Controller component attached to the main camera. The variables are named inGamePosition and inGameRotation.
     
  6. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive.. That works!! thanks. The spawn full length check box not working, the last platform doesnt have scene object.

    For cuves, how can I find the offset values? Because my turn platform is too long, I couldn't find the the correct offset values. Thanks
     
    Last edited: Dec 6, 2013
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    You're talking about the center offset values? That's just a matter of playing with it. In a future version I plan on adding the ability to change it through the Unity editor but for right now it is a manual process of trial and error.
     
  8. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Yes the centre offset values, it repositions the scene object which follows the curve in pixels on every turns. It shows gap between objects. I tried so many values but not get it. One more problem is sometimes the player turns like he does in L turns that is he is not following the curve, this makes him to fall off the track.

    I am seeing a new issue in the game. The scene objects which has certain platform linked to it seems to be spawn one after other. Say my scene has only two lanes with its platform linked, in some distance the platform object spawned first then the scene object spawns with some other platform. Is this happens because of the change in the infinite object generator script you gave recently.
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    The center offset only affects the objects after the current object. If there is a gap in between the previous objects and the object that you are adjusting the center offset of, you should instead be adjusting the position within the transform component. You can also adjust the models pivot point which will have a similar effect as adjusting the position. As far as the two other issues, can you send me steps to reproduce?
     
  10. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Hi,

    Just purchased this over some of the other kits on the Asset Store, as this seems to have a greater community around it, and great support from the developer. So fist off, thanks for a great product!

    As for the 1.5 update, do you have an ETA for this? Also do you have a working list of changes/features that will be in 1.5?

    Adam
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Hi Adam,

    First off, thanks for your purchase. As far as 1.5 goes, it will probably be later January. Our artist is currently working on revamping our website and then she is going to start on version 1.5. I am also traveling from January 3 to the 13th and will have very limited access to Internet. Once I get back the focus will be on getting version 1.5 out. For version 1.5 we plan to add an enemy chasing the main character as well as mecanim support. I am going to start implementing the chase enemy within a week or so. If you're interested in this, I can send you what I have as long as you don't mind that a cube will be chasing the character :)

    ---

    Also, yesterday Unity accepted version 1.4.2 of the starter pack. This version contains the following:
    • Improved jumping
    • cast a ray to improve the collision with platforms that change height (pro version only)
    • Added NGUI 3.0 scene (within Unity package file)
    • Jump and slide can completely be disabled by setting the PlayerController.jumpForce or PlayerController.slideDuration to 0
    • Saving more details for the startup objects (pro version only)
    • Minor bug fixes

    Required Changes:
    • Startup objects that created in previous versions will no longer work. Startup objects can be created again using the same method as before.(pro version only)
     
    Last edited: Dec 11, 2013
  12. InitoryDad

    InitoryDad

    Joined:
    Jul 3, 2012
    Posts:
    21
    Great, 1.4.2.
     
  13. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Hi,

    I would love to see the new chase in action. Id be happy to test this out for you as well and report back on any issues I find.
    Would you be supporting mecanim animations for the chaser as well? That would be great.

    Adam
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Definitely, I'll send it to you as soon as I get something worth sending.

    We are planning on having a dragon chase the character so I'd love to be able to support mecanim for the chaser as well as long as we can make a suitable mecanim animation for a dragon
     
  15. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, I want mecanim support as well. Please Send me the update when u r done with it. Thanks
     
  16. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Just need one suggestion. How to add different locations, should it be in one scene or we can load different scenes? Any ideas, I have three different locations button which allows the user to choose their desired environment. Thanks
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    There are two different approaches that I would take for that:

    1. The easiest way would be to place the "Infinite Objects" game object in difference scenes. I am assuming that you would have a main menu scene with this and in that case I would put the "Game" game object within that scene marked as DontDestroyOnLoad (http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html) to prevent it from being removed between scenes.

    2. The disadvantage of the above method is that you have to have multiple "Infinite Objects" game objects so if you change a value within there you are going to have to change it everywhere. Also you would have a brief pause as Unity loads the new scene. The way that I would recommend is to add one more layer to the SectionSelection hierarchy. Depending on the section selection type that you are using, you will either need to make a list of startSection/endSection or a list of DistanceValueList. Each entry in the list will correspond to a different location. For example, if I am using a linear section type, part of SectionSelection.cs would look

    public int currentLocation;
    public List<DistanceValueList> sectionList;

    sectionList[0] will correspond to the first location, sectionList[1] will correspond to second location, etc. Using this method you can just mark which objects appear within each location by their section, and when you are ready to load a particular location you only have to set currentLocation. Using this method you don't have duplicate "Infinite Objects" game objects and everything is very clean.
     
  18. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    I don't suppose you have any idea when you will have an initial mecanim version to send over? I tried implementing one myself but its not working out to well...
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    That won't be until later in January. I can fake the chasing part without needing my artist but for mecanim we are both going to have to work through it at the same time.
     
  20. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Ok no worries. I will focus on other areas for now and then come back to the mecanim integration when nearer that time
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Earlier I mentioned that I was going to use a cube to represent the enemy chasing the character. Well, I decided to stretch my art ability and use something that isn't a cube:

    $dragon main screen.PNG

    I was pretty proud of myself with this dragon :) You can see a preview here. I don't think that it needs to be said, but when we release this version the dragon will of course be done by a real artist. This is just a preview for the code. I will send out the Unity package to those that requested the chase feature. Anybody else who wants this version just send me an email or PM.

    $dragon.PNG
     
  22. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi, This idea sounds good. Can you explain a little bit more on this method? also on SectionSelectionInspector.

    getting this error
    Assets/Infinite Runner/Editor/InfiniteGenerator/SectionSelectionInspector.cs(36,27): error CS0029: Cannot implicitly convert type `System.Collections.Generic.List<DistanceValueList>' to `DistanceValueList'

    Thanks
     
    Last edited: Dec 20, 2013
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Yes, you'll also have to update the inspector to reflect the new structure. This addition requires some more work then changing one or two lines of code. I will add it to the list of feature requests.
     
  24. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,455
    @Opsive,

    I just got this really cool pack. Wondering if it's possible in a future version to support DaikonForge. Reason is that like so many people, I've switched from NGUI to DaikonForge because it's a much better GUI system.

    Cheers.
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Sure, I'll look into it after we get version 1.5 released. I have a version that works with UIToolkit and I could probably do something similar with DF. On a related note I will definitely update the pack to support the new Unity GUI whenever that gets here.
     
  26. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Thanks for adding in your it on your feature requests. For time being, can I use the following method to get it done. Taking four prefabs of the 'infinite objects' game object each contains its own location assets. And changing it in the game manager.

    Thanks
     
  27. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Is there some thing I need to set up for the android? Because when I start the game in landscape I have to tilt my phone side ways to change positions. same if I do a portrait build I have to play it side ways also. But if I set it to swipe to change positions it works fine with swipes.
     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    @Dharma_raj -

    I don't completely follow. The Game Manager doesn't have anything to do with spawning objects. The only way that you are going to be able to do it without changing any code is to have individual scenes that contain a unique InfiniteObjectManager component that has its own objects assigned to it (this is idea number 1 from before). Idea number 2 gets around this requirement by overloading the sections with level data.

    @John Sandrey -

    So it looks like it is an accelerometer problem? Are you testing against the demo scene? I just tested it out by building a landscape and portrait version and everything looks like it is working related to changing slots in the different orientations, but I'd love to be able to reproduce the issue that you are having.
     
    Last edited: Dec 23, 2013
  29. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    yea I am using the demo scene, just purchased the pack yesterday. I will see what I can do about getting a recording but how do i put the recording up here? Also going to try it on a tablet to see if it still happens. only tested it out on a samsung note II so far.
     
  30. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Yea still does it on a tablet going to try to video it.
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    You can either upload it to dropbox and post a link or send it to me as an email attachment (support@opsive.com)

    What orientation settings are you using (found within the player settings)? The only Android device that I have tested on is a Nexus 7.
     
  32. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
  33. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    The only thing i did was take ngui out and put the paid version in. I don't think that did anything.
     
  34. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    is there a setting in unity i need to change may be?
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Changing NGUI shouldn't have done anything. In the InputController there are two parameters that you can try adjusting - accelerometerRightSlotValue and accelerometerSensitivity. There are comments above the variable which tell you what it does. Try reducing those values to see if that helps.

    If that still doesn't work, can you modify line 110 of InputController.cs to output some debug data:

    Code (csharp):
    1.  
    2. if (!swipeToChangeSlots) {
    3.    Debug.Log(Input.acceleration);
    4.    checkSlotPosition(Input.acceleration.x);
    5. }
    6.  
    And paste that debug data here so I can see what values you are getting when you tilt the tablet.
     
  36. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Hmm thats odd, It works with unity 4.0.
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Strange.. I never did test Android over 3.5.7 because I couldn't get Unity working properly with the Android sdk. It worked with 4.x though so I just stuck with that. I did test the starter pack on Unity 3.5.7 on iOS though and the accelerometer worked there. Are you planning on developing with 3.5.7? If so if you could paste the accelerometer debug statements that would help a ton.
     
  38. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    yea I have the pro licenses for 3.5.7.
     
  39. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    But I don't think that should make a difference with the accelerometer. Going to try another 3.5 install to see if it was a glitch.
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    You wouldn't think so. If it does still happen and you can send me the Debug.Log data that would be great.
     
  41. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Yea it still does it with 3.5.7. don't have much time to do the debug setup working 12 hour days and gone for the holidays. I will look into it when i get time. unless you figure it out first. But it only happens on the mobile device not sure how to get a debug log off a phone.
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Unfortunately I keep getting an unknown error with Android when I try to build it with 3.5.7 so I don't think that I am going to get to it first. As a quick test try reducing the accelerometerRightSlotValue and accelerometerSensitivity values to see if it makes a differences. I would try a accelerometerRightSlotValue of 0.05 and accelerometerSensitivity of 0.01 just to see if you are getting any accelerometer data. To get the log files take a look at this webpage: http://docs.unity3d.com/Documentation/Manual/LogFiles.html
     
  43. akraol12

    akraol12

    Joined:
    Oct 4, 2013
    Posts:
    2
    Opsive, ty for awesome pack, really helpful for my project. I'm trying to use my own character model, and I'm getting this error
    NullReferenceException: Object reference not set to an instance of an object
    DistanceValueList.getIndexFromDistance (Single distance) (at Assets/Infinite Runner/Scripts/InfiniteGenerator/AppearanceProbability.cs:148)
    DistanceValueList.getValue (Single distance) (at Assets/Infinite Runner/Scripts/InfiniteGenerator/AppearanceProbability.cs:118
    PlayerController.Update () (at Assets/Infinite Runner/Scripts/Player/PlayerController.cs:180

    Maybe I missed smth, but I'd really appreciate some help.

    Also I'm getting errors with Quaternions, when applying speed 0-end in PlayerController.cs. Why is it so?
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Which version of the starter pack are you using? Line 180 of PlayerController.cs assigns a bool so there is no way that could be causing problems.
     
  45. akraol12

    akraol12

    Joined:
    Oct 4, 2013
    Posts:
    2
    Sorry, I really thought i've updated my project, but looks like I was wrong. In version I used this line assigned a float ForwardSpeed. Right now I have version 1.4.2 and I pretty sure the problem will be solved. Btw, thanks for quick reply :)

    Well, it wasn't. Here's a mistake.

    NullReferenceException: Object reference not set to an instance of an object
    DistanceValueList.getIndexFromDistance (Single distance) (at Assets/Infinite Runner/Scripts/InfiniteGenerator/AppearanceProbability.cs:148
    DistanceValueList.getValue (Single distance) (at Assets/Infinite Runner/Scripts/InfiniteGenerator/AppearanceProbability.cs:118
    PlayerController.Update () (at Assets/Infinite Runner/Scripts/Player/PlayerController.cs:219)
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    I left my computer for a few hours so I can't look at the exact line but based on what you said and the stack dump it does look related to forward speeds. Make sure you have them assigned within the player controller (towards the bottom of that component)

    Edit: I just got back. Yes, it is definitely related to forward speeds. Make sure you have them setup on your character.
     
    Last edited: Dec 23, 2013
  47. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    One more quick question, When making my own platforms, does the size of the platform make a difference ? I know in your video you used one that came with the package, and wasn't sure if the length and the width made a difference when adding the platforms.
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    No, the size does not matter. If you are using platforms and scenes I recommend that the lengths be multiples of each other, but really if you're not using turns or jumps that part doesn't even matter. In the demo scene all of the platforms and scenes have a length of 14 units. The S-Bend platform has a length of 28 units. When the S-Bend is spawned, two scenes will be spawned next to it instead of just one.

    If the starter pack can't figure out the size of the platform or scene because you've split the object up into multiple pieces you can manually specify the size through the override size variable attached to the Platform and Scene Object.
     
  49. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Thanks, Is there any thing else I should keep in mind when I make my own platforms?
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    I can't think of anything, it should be pretty easy to switch to your own objects.