Search Unity

Infinite Runner Starter Pack

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

  1. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    Hi, after setup platforms and Obstacles, charactere, i have this erroe when i hit start in Ngui menu

    NullReferenceException: Object reference not set to an instance of an object
    InfiniteRunner.Game.DataManager.GetCharacterPrefab (Int32 character) (at Assets/Infinite Runner/Scripts/Game/DataManager.cs:241)
    InfiniteRunner.Game.GameManager.SpawnCharacter () (at Assets/Infinite Runner/Scripts/Game/GameManager.cs:93)
    InfiniteRunner.Game.GameManager.Start () (at Assets/Infinite Runner/Scripts/Game/GameManager.cs:78)
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    I'm betting what happened is that after you replaced the characters, you didn't replace as many characters as there was previously so the selected character index is out of range. This index is stored in the PlayerPrefs - doing a PlayerPrefs.DeleteAll will bring everything back to its default state. Insert PlayerPrefs.DeleteAll() in any executing method (such as GameManager.Start), hit play, and then stop the game. Remove this line and you should be good to go.
     
    LAFI likes this.
  3. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey opsive, i sent you a pm regarding this asset but if you rather i post here then thats fine
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Just responded to your PM - it has been a hectic morning for support but I think my head is above water now :)
     
  5. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    hi
    thank you for your great assest
    please can i add IAP,, for android and facebook??
     
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    There is not a built-in IAP system. The reason for this is that I wanted to keep the code platform independent, and IAP is a topic on its own. You should have no problem integrating any of the IAP plugins on the Asset Store though. The most common function is awarding coins after the user makes a purchase. You can do that with
    Code (csharp):
    1. DataManager.instance.AdjustTotalCoins(Number of Coins, True/False);
    Where Number of Coins is the amount of coins to add and True/False indicates if you want to adjust the primary coins (True) or secondary coins (False)
     
  7. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    okay cool thank you so much, please an other question, can i use the new UI system( unity5)??
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Yes - if you extract the Infinite Runner/uGUI Assets package you'll have a uGUI scene.
     
  9. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    Thanks Man :)))
     
  10. amiri.76

    amiri.76

    Joined:
    Sep 16, 2015
    Posts:
    5
    hello Opsive
    we're planning To Use Ai in your asset
    So we have a Question
    How to Spawn Enemies in 3 Lines Without overlapping Obstacles
    Take Look at This Pictures , The name of the game is Blades of Brim
    Tnx , Ehsan
    Tnx , Ehsan
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    There isn't any special setup required - you can spawn your enemies just like any other objects. On the PlatformObject you can adjust which slot objects can spawn in, as well as the number of objects that can spawn on top of the platform. If you always want your enemies to be in a certain formation you can create a prefab with all of your enemies and then spawn that prefab. This would be done very similarly to the coin group prefab.
     
  12. amiri.76

    amiri.76

    Joined:
    Sep 16, 2015
    Posts:
    5
    Tnx For your Quick Response
     
  13. amiri.76

    amiri.76

    Joined:
    Sep 16, 2015
    Posts:
    5
    Hello Again Opsive
    I want to change animations by adding a mecanim state to it
    The state is Spell cast
    when Player double tap on screen
    it'll Cast A spell rapidly
    i'm already Done the Touch counter
    But now can you help me with
    Animator
    and can u guide me that how I can do the scripting?
    thanks for your attention,Ehsan
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    I would add a new trigger to the Animator Controller that is set when you double tap on the screen. You should then create a new state that will play the spell animation. From there you can add transitions to this new spell state, and trigger it within the code that you added to detect a double tap. For this you would use Animator.SetTrigger:

    http://docs.unity3d.com/ScriptReference/Animator.SetTrigger.html
     
  15. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    hi,
    when i add power ups into infitie object i have this error

    NullReferenceException: Object reference not set to an instance of an object
    InfiniteRunner.Game.DataManager.GetPowerUpLevel (PowerUpTypes powerUpTypes) (at Assets/Infinite Runner/Scripts/Game/DataManager.cs:266)
    InfiniteRunner.InfiniteGenerator.PowerUpAppearanceRules.CanSpawnObject (Single distance, ObjectSpawnData spawnData) (at Assets/Infinite Runner/Scripts/InfiniteGenerator/PowerUpAppearanceRules.cs:26)
    InfiniteRunner.InfiniteGenerator.InfiniteObjectManager.GetNextObjectIndex (ObjectType objectType, ObjectSpawnData spawnData) (at Assets/Infinite
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Did you add the power up level to the StaticData component? This is located on the Game GameObject.
     
  17. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    yes i already do it, but still have the error
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    That error will only occur if you try to use a power up type which is has an index greater then the total number of power ups. If you set a breakpoint on line 266 of DataManager.cs what power up type is it trying to access? Taking a step back, did you change the PowerUpTypes enum within PowerUpManager to add your new power up type?
     
  19. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    no, i did't change any thing , i use your power ups
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Do you have an appearance rule setup on one of your objects that is referencing a power up not within the power ups array? You can try just completely removing all appearance rules and then see if you continue to get the error.
     
  21. LAFI

    LAFI

    Joined:
    Sep 5, 2014
    Posts:
    47
    no i don't have any apparence rules refercenig a power up with my other objects
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Based on that stack trace there is some appearance rule causing a problem. I would remove all of the power ups and add them back one by one. When you do this you can then see which power up is causing the problem and remove the appearance rule setup.
     
  23. Fcaldas

    Fcaldas

    Joined:
    Jul 6, 2015
    Posts:
    21
    I can't seem to get the Character Creation wizard to work. I drag my Character Model (fbx) to the Character Mode and also add the Character1 prefab to the Particles Source and add the animations names to every element. But, the Create button is disabled.
    Any idea why?
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Did you add the speeds? The character model and speeds are the two parts that are required for the Create button to be enabled.

    speed.PNG
     
    Fcaldas likes this.
  25. Fcaldas

    Fcaldas

    Joined:
    Jul 6, 2015
    Posts:
    21
    well, I feel like a dumba** right now. Thanks opsive, much appreciated!
     
  26. Lialice

    Lialice

    Joined:
    Oct 18, 2013
    Posts:
    6
    Hi Opsive
    Is it possible that there is some incompatibility with Unity 5.2.1f? I've imported everything into an empty project, but the Unity Editor freezes when I press Play in the Main Scene.

    Edit: Ah, sorry, the actual problem seems to be that the Scenes.fbx wasn't imported properly ("A default asset was created because the importer crashed the last time".
    Everytime I try to reimport, the Editor crashes.
     
    Last edited: Oct 13, 2015
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    I've had one other report of this occurring with Unity 5.2. I'm not able to reproduce it though - can you submit a bug report to Unity so they can fix it? Have you tried the latest patch release?
     
  28. Lialice

    Lialice

    Joined:
    Oct 18, 2013
    Posts:
    6
    I'm using the newest Unity version. Yes, I can submit a bug report.
     
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Have you tried the latest patch release as well? Thanks for submitting that bug report!
     
  30. Lialice

    Lialice

    Joined:
    Oct 18, 2013
    Posts:
    6
    Aha, no, I had not downloaded the patch release!
    It works with the newest one, thank you! :)
     
    opsive likes this.
  31. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    218
    Do you have any plans to upgrade this asset?
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Yes, we actually started on a version 2 but put it on hold for our other assets. This asset is a mature asset though so it's very feature complete and hasn't needed as many updates. In 2013 and 2014 it went through a lot of revisions. There's always stuff that you can add or make easier though and this is what we are planning on doing for version 2, including a PBR scene. I expect that we'll start back on version 2 in 2016.
     
  33. amiri.76

    amiri.76

    Joined:
    Sep 16, 2015
    Posts:
    5
    hello , We ' re planning to Use "PolyWorld Woodland Toolkit" In our project , But according to Custom Infinite runner Shader we have any chanse to use this pack ?
    Tnx
    , eak7nfonlujdisfxbjsw.png
     
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    I haven't used PolyWorld before so I don't know what their shaders look like, but you'll want to move the vertex transformation shader code over to theirs. This is the block of code within the vertex shader starting with the "Apply the curve" comment.
     
    amiri.76 likes this.
  35. aaaaabbbbb

    aaaaabbbbb

    Joined:
    Feb 14, 2015
    Posts:
    15
    Hi

    you are amazing developer.

    I bought this many time ago.

    you helped me a lot thanks.

    I learned that you will release a new version of this great asset.

    when we think this asset released in 2013 it was amazing anyway

    I want to suggest a game.if you can do like this to me it will be amazing.

    the link https://www.assetstore.unity3d.com/en/#!/content/32543

    if you can not you are still genius does not really matter you to do or not.this is just a suggestion.

    thanks in advance.
     
  36. opsive

    opsive

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

    Our next asset is actually going to be similar to that. We announced it here, and it'll allow team based or free for all deathmatch style games. I'll post a thread in the WIP section as soon as we get further.
     
  37. Octo-Games

    Octo-Games

    Joined:
    Jan 6, 2013
    Posts:
    45
    Hello i used your asset but when i try to put my own scenary they all float over the path it's strange , do you think you could help me out `? maybe by skype ?
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    Have you tried adjusting the y value on the object's prefab? When the objects are placed the prefab position is used as a relative offset.
     
  39. Octo-Games

    Octo-Games

    Joined:
    Jan 6, 2013
    Posts:
    45
    I tried to adjust the value of the position but when i start my prefab is flying and moving in different directions (left , right , etc..)

    in the documentation it said put to 0,0,0 but it didn't changed either , i builded my prefab over the castle scenery so the size , the position should be just fine ...

    do you want some kind of screenshot ?

    EDIT:
    Here are some screenshots:
    http://www.noelshack.com/2015-47-1448018862-sscrnbug1.jpg
    http://www.noelshack.com/2015-47-1448018861-scrnbug2.jpg
    http://www.noelshack.com/2015-47-1448018861-scrnbug3.jpg
     
    Last edited: Nov 20, 2015
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
  41. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    557
    Is it possible to make the player fly like subway surfers?
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
  43. GB51

    GB51

    Joined:
    Nov 5, 2015
    Posts:
    31
    Hi! Just like to know if this asset is compatible with Unity 5.3, Thanks ! :)
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    It is!
     
  45. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey just a quick query - could this ostensibly work with finalik and puppetmaster?
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    I can't think of a reason why it wouldn't. The PlayerController only plays the animations so FinalIK or PuppetMaster should be able to sit on top of it.
     
  47. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Before i go rtfm, would the effect of puppetmaster and some ik behaviour be problematic as the world moves rather than the character, or am i thinking abouf it wrongly
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,683
    What is your end goal? To switch to PuppetMaster when the character dies from hitting too many obstacles? If this is the case you'll have to do a couple of things:

    1. Switch the hit obstacle into a collider instead of a trigger. This is so PuppetMaster will correctly interact with it.
    2. Apply a force to the character after death. This will allow PuppetMaster to apply its ragdoll after the character dies.
     
  49. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I feel that using puppetmaster just for death sells the system far short - i was thinking of glancing hits that might stagger them, tripping over or falling from a collision with geometry then getting back up to continue - maybe this figure into ypur current system of runner 'types' where you could define weak limbs (unpins more easily if hit, encouraging asymetric play) or conversely greater resistance to impact with maybe a little backstory about these idiosyncracies

    Just some ideas i had while figuring out what im aiming to do at the moment
     
  50. TheJare

    TheJare

    Joined:
    Jul 2, 2013
    Posts:
    2
    Hey opsive, first of all GREAT work on the starter pack, I seem to have a weird bug though, where all of my scenes seem to be moving slightly in one direction every time they spawn. If I for example Incorporate any type of turn, eventually the collider of the scenery for the turn will hit me before the turn Hitbox does making it impossible to turn. I would appreciate any help.

    and while we are on the subject, how would you go about adding more coins or making the scene autoplay and skip the UI entirely?