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

Infinite Runner Starter Pack

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

  1. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    I placed a debug.log inside attack(), it works for a few times, then it stops printing in console. And when I restart from the menu, no print as well.
     
    Last edited: May 28, 2014
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Chances are canAttack is still false. Try resetting the value within orient instead of Start:

    Code (csharp):
    1.  
    2.     public override void orient(PlatformObject parent, Vector3 position, Quaternion rotation)
    3.     {
    4.         base.orient(parent, position, rotation);
    5.         ...
    6.         canAttack = true;
    7.     }
    8.  
     
  3. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    Orient? I'm using ObstacleObject.cs
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    You still can override orient since ObstacleObject is inherited from an InfiniteObject. As an example take a look at the MovingObstacleObject. You just won't have anything in between the base.orient and setting the bool
     
  5. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    Working fine now, thanks.
     
  6. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    For the missions, once I completed the mission, i.e. reach 5000 points. How do I reset back to novice runner mission?
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
  8. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    I've deleted play count in the registry, but it still shows play mission complete.
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    The the ones that start with mission as well.
     
  10. RPG_Obssesive

    RPG_Obssesive

    Joined:
    Apr 23, 2014
    Posts:
    4
    Hello opsive,
    sorry I dont know whether this is the right way to contact you about these queries but I am interested in purchasing your infinite runner start kit however there are three things I wish to implement my self and I was wondering if it would be possible and how hard it would be using this kit to do so myself.

    - Create a bent horizon effect as seen here (If I bought this asset would it be easy to implement it into your starter pack?): https://www.assetstore.unity3d.com/en/#!/content/9750
    - Replace the running man with a cart on a 3 track railway for the 3 positions (Like the kart in temple run 2 when that section appears although in temple run its only 1)
    - Implement a tilt function onto the kart as where you tilt your iphone the kart will lean on the left side of the rail or the track or the right side.

    Many thanks! :)
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    This thread works :)

    Thanks for taking a look at the starter pack -

    1. The starter pack already includes a curved shader that allows you to change the curve horizontally or vertically (or both). With that said, if you wanted to use the shaders within Runner Horizontal Bending you could. You would just need to swap out the shaders within the materials.
    2. The character doesn't have to actually be a character and replacing it with a kart should be very similar to the steps listed for using your own character. The 3 track railway would be modeled on your platform object.
    3. That should be straight forward. In the player controller you would adjust the rotation of the kart based on the Input.acceleration value.
     
  12. RPG_Obssesive

    RPG_Obssesive

    Joined:
    Apr 23, 2014
    Posts:
    4
    That is amazing news thank you for such fast and good feedback :)
    Elaborating on the curved shaders (Sorry i am rather new to this) would this actually make the horizon line curve? I thought I would have to actually bend the platform or put the platform over a sort of continuous hill to get this effect as it looks within the asset i referenced in my previous post?

    Thanks :)
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Take a look at this image -

    $curve.PNG

    This is a screenshot of the curved shader that is included in the pack. I have selected all of the objects so you can see the light locations and the collision boxes. You'll notice that those are in a straight line but the mesh appears to be curved. You don't actually have to model the curving - the vertex shader does this for you. You should be able to achieve similar results with the included shader as what the Runner Horizontal Bending shader gives you
     
  14. RPG_Obssesive

    RPG_Obssesive

    Joined:
    Apr 23, 2014
    Posts:
    4
    Yet again thanks for the fast response and demonstration :D Is it also possible to do this curve vertically? As if you were going over a hill?
     
  15. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Yes, you can adjust it horizontally and vertically.
     
  16. RPG_Obssesive

    RPG_Obssesive

    Joined:
    Apr 23, 2014
    Posts:
    4
    Cheers for all the really good feedback it has been very helpful! :)
     
  17. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    My store is not same of demo, why not ? characters and power ups are small and a little away :\
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Can you post a screenshot? The web demo was created with the version out on the Asset Store.
     
  19. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11

    It that happens. Sorry i not speak english law :)
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    It looks like the scale factor of the model is set to 0.01. Either try importing again (making sure you first delete the /Infinite Runner folder) or set the scale factor to 1:

    scale.PNG
     
  21. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    Well.... my scale factor it's 1.. and if I increase the scale, the character increases, but they are "backwards", "floating" and not is same of demo... my Unity version is 4.5 will that be?

     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Strange.. I just imported from the Asset Store with Unity 4.5 from the Asset Store and it worked fine -

    4.5.png

    You're the first person to report this (lucky you :) ). Did you try reimporting into a new project?
     
  23. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    I tried importing in new project and also i tried in importing only models and prefabs of characters, and same problem :\ The rest operate normally, only store not worked fine... When I die and i click in store the problem it's same.

    In menu worked fine.
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    ohh it was from the store. Ok, yes, I am able to reproduce that and it does look like it is specific to Unity 4.5.

    To fix the character being too small, change the rotation and scale of the "Character Preview" GameObject to the following:
    character.PNG

    Then you'll need to do something similar for the "Power Up Preview" GameObject:

    powerup.PNG

    If you just make these changes the power up will still be really small so you'll also need to make the following code change:

    In /Infinite Runer/Scripts/Game/GUIManager.cs, go to line 390. Change:

    Code (csharp):
    1.  
    2. storeItemPreview.transform.localScale = Vector3.one;
    3.  
    To:
    Code (csharp):
    1.  
    2. storeItemPreview.transform.localScale = storePowerUpPreviewTransform.localScale;
    3.  
    Now it will take the scale that you set in the hierarchy. This will fix the issue, but I am still curious what changed in 4.5 so I'll keep looking into it and post here if there is a better fix that works across Unity versions.
     
  25. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    Maybe is layer or no, because in Unity 4.5 the layer UI is default, ... i tried in Unity 4.3 without layer UI and the result it's same the 4.5, but i tried with layer UI and the the store worked fine, equal of demo :) it's version of Unity that modified something....
    Thx for support :)
     
  26. drillf00t

    drillf00t

    Joined:
    Jun 8, 2014
    Posts:
    1
    Opsive, great kit, it has been fun to play around with. Definitley worth the purchase. I've read most of the post here, and followed the video tutorial and the tutorial available on the web site, but I still have issues. I checked character controller, and checked that my speeds matched the ones in the screenshots, but my problem is the character I import does not move, and when he appears their is two of them. I've posted screens. Thanks.

     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    That's what it is! In 4.5 they added the UI layer which I had manually created. Ok, that explains things. So you actually don't have to do the modifications that I mentioned above. Instead all you need to do is the following:

    Change the UI Root (2D) GameObject and its children to the to the UI layer:
    root.PNG

    Then change the culling mask on the main camera to not render the UI layer:

    MainCamera.png

    Finally change the layers on the camera under UI Root/Camera to the UI layer. Note that it will probably already say UI but it doesn't actually work so set it to the UI layer again:

    camera.PNG

    From that it should work. The character appears dark in the store but you'll just need to adjust the lighting.

    Happy to hear that you're enjoying it! Are you getting any errors? For the duplicate character, make sure you don't already have a character in the scene when you start the game. The character will be spawned from the character that you set in the static data manager.
     
  28. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    Yeeeahh, now finally worked fine, super fine :)
     
  29. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    How i use the font that i want ?
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
  31. tobicreaper

    tobicreaper

    Joined:
    Apr 30, 2013
    Posts:
    69
    Hi Opsive. Your package is great. But I am facing a little problem. When I try to use my own scenery the character always falls through and keeps falling. Also neither the scenery nor the platform appear. But when I dont link my scenery prefab to "Infinite objects" .. the game runs fine. The platforms appear. But as soon as I link my own prefab of scenery.. the platforms and the scenery prefab dont appear. I did everything that you mentioned in the video and documentation. Help me plz. Thanks
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Are you getting any errors? Also, can you explain more of what you are doing when you say link to "Infinite Objects"? Your scene will be linking to a specific platform prefab. My suggestion is to first get it working with just a single platform object and no scene objects. Once you have that working you can then start to add from there.
     
  33. tobicreaper

    tobicreaper

    Joined:
    Apr 30, 2013
    Posts:
    69
    Hi opsive, Thanks for the reply. What I meant by ''linking to infinite objects" was feeding the prefab of my scene into the infinite objects that is present in the hierarchy. We have to feed the prefabs of all the obstacles and scenes in the "infinite objects" in hierarchy , dont we ? Also I did link the prefab with the platform. I have two scenarios here :-

    1) When my scenery prefab is not a single mesh, ie it has 4-5 houses which are seperate meshes each having its own texture brought under a single prefab. When I use this prefab the platforms dont appear and the player just keeps falling.

    2) When I used a single house to see if the prefab containing single mesh will work, the alignment is very bad. The collision boxes are spread on the platform which leads to the player not moving forward when comes in contact. Also, those houses are not at all aligned.

    Kindly help me solve the problem. Thanks.
     
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    You need to add all of the objects to the Infinite Object Manager component on the "Infinite Objects" GameObject, yes. Generally unless there is a specific reason to link the scene to the platform you don't have to setup a link. Specific reasons include the left turn scene should always go with the left turn platform, the stairs up scene should always go with the stairs up platform, etc.

    1. The Infinite Object Manager determines the size of the object based on the mesh. In your case since you have multiple meshes it is unable to determine the correct size. To correct this, just specify a size within the override size variable:

    overridesize.PNG

    2. The collision boxes don't change, so something must be placed wrong within the prefab. If the platforms/scenes are misaligned, take a look at this help topic: Object Misalignment
     
  35. recagonlei

    recagonlei

    Joined:
    Feb 27, 2014
    Posts:
    11
    Thanks Opsive i solved my doubt of font, thx again :) !
     
  36. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, You have done a great job on creating this pack, it helped us a lot to make our endless runner game. And your support is really good for us to overcome issues. Our game reaches the final stage, however we need some suggestions from you to make our game more interesting. First I want to ask you how to get coin stream like subway surfers when the player is on the jetpack, see attached image. We have a flying powerup that takes up the player some height and we re positioned the coins to player's y position. Since the coins prefab is a straight array of coins, we didnt get the surfers like effect( see image). Also the infinite generator spawns obstacle so that the coin spawning is not continuously occur. Any ideas would be great!!
    Thanks
     

    Attached Files:

  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Great to hear that you are getting close!

    Probably the easiest way to achieve what you are describing is to modify the InfiniteObjectGenerator. Add a bool that puts it in a mode so it will only spawn coins. You would then modify lines 234-246 of InfiniteObjectGenrator.cs so that it can only spawn coins when that bool is active. Take a look at the comments within that block for an idea of what the code is doing.
     
  38. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88
    Hi All,

    Am a Freelance Developer and I am currently involved in adding various functionalities to this Infinite Runner starter pack... if anyone needs help adding new feasible features ..i would love to spend time for milestone based payment after reviewing the features required...
    do ping me with the feature required and ill get back to you asap..
    thanks for the time...
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    This was the first that I heard of this. As a precaution, neither I nor the Infinite Runner Starter Pack are affiliated with aCat4mIndia so use the service at your own risk. Also, just as a side note, if I receive enough requests for a particular item I will add it to the version on the Asset Store. With that said, thank you for offering your services aCat4mIndia.
     
  40. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88

    oops... sorry for hijacking your thread on the official asset store plugin thread...excuse me...

    do let me if you want me to delete the post which i made....

    thanks...
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    No worries. Currently I am unable to do any freelance work so it's good that there are options. I just didn't want to confuse anybody into thinking that you were starting to provide the official support for new features.
     
  42. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88

    thanks...
     
  43. tobicreaper

    tobicreaper

    Joined:
    Apr 30, 2013
    Posts:
    69
    hi, thanks a lot for your last reply.. It really helped, the enviornment is now properly integrated. I must say your support is awesome. thanks once again. There are a few more things that I need to ask.
    1) How do I implement a JETPACK feature
    2) I dont need the invincibility powerup. Instead I need a shield. Which is same as invincibility except the auto turn feature is not there. So I edited the "turn trigger script" and now it works fine. the only problem is that I want to show a small sphere engulfing the player during shield/invincibility. How do I do that ?
    kindly help me thanks
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    Great to hear!

    1. That will require some custom scripting. You'll need to modify the PlayerController so that it adjusts the y position when the Jetpack power up is active. You'll want to start looking at PlayerController:Update and modify from there.

    2. You should be able to just swap out the particles.On the PlayerController you'll need to switch out the particle system at element 2 within the power up particle system array. If you want to enable an actual game object instead of just particles then you'll need to modify PlayerController:activatePowerUp. As an example take a look at the coin magnet power up - that power ups activates a trigger so it can collect the coins with a wider radius.
     
  45. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    Opsive, I've tried to play an animation from another gameobject, but it's not playing. Since my raycasting code is in PlayerController, in the attack function, I've set so that if the ray hits the enemy soldier, the death animation will play. I've created a public GameObject enemy, and enemy.animation.Play("Death_AI");. Debug.log shows that it hits but the animation is not played, I've dragged the enemy soldier prefab and it has the animation compenent.

    Edit: Got it to work using GameObject.FindWithTag, but it only works a few times. Also when within range the attack animation plays and the enemy gets back up.
     
    Last edited: Jun 26, 2014
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    That's very tough to say without seeing the code. Can you post what you've done? Also the modification that you made with FindWithTag in order to get it to work.
     
  47. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    The enemy animations code is kinda complicated. Firstly, I used the obstacleobject script for my enemy AI, so that it'll spawn in the three slots. I added a tag to the enemy prefab, so it doesn't affect the other obstacles. I duplicated the playeranimation script called AIanimation for my AI and attached it to the enemy prefab . If within range, it'll play the attack animation. However, my raycasting code is in PlayerController script that is attached to the player prefab, so I tried to play the death animation from AIanimation, but it doesnt work. So I used animation.play instead, and got the problem mentioned above. Playercontroller line 562.

    mod edit: removed attachments as they contain copyright code that should not be distributed on this forum
     
    Last edited by a moderator: Jun 27, 2014
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    If you need to include files from the starter pack please send me a PM or email with them rather than posting them on the forum.

    That said, you commented out the following code:

    Code (csharp):
    1.  
    2. //               obstacleObject = obstacleobj.GetComponent<ObstacleObject>();
    3. //               obstacleObject.canAttack = false;
    4. //               obstacleObject.death();
    5.  
    I think that you are close, except instead of obstacleObject.GetComponent you should do:

    Code (csharp):
    1.  
    2. hit.transform.GetComponent<ObstacleObject>();
    3.  
    Furthermore, it doesn't look like the variable obstacleObject was defined anywhere so you need to do that first.
     
  49. areszues92

    areszues92

    Joined:
    Dec 16, 2013
    Posts:
    78
    I tried the code I commented, didn't work. The death function is called (tested using debug.log), but the animation doesn't play. It's kinda confusing, obstacleObject was declared on top as a object to the ObstacleObject class. obstacleobj is the enemy prefab gameobject, so I can access the ObstacleObject functions and the enemy animations.

    Edit: Tried the hit.transform you suggested, same death animation doesn't play.
     
    Last edited: Jun 28, 2014
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,119
    If the death function is called then you at least have the right start. Are you using mecanim or legacy? Do you have backwardDeathAnimationName defined and made sure that the corresponding Play animation function is called?