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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Infinite Runner Starter Pack

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

  1. code749

    code749

    Joined:
    Jan 17, 2009
    Posts:
    100
    also it would be good to setup a character system which incorporates more animations...like ways to die in temple run...stumble etc


    good job so far

    fine tune the gameplay/controls before adding more features..i will have more controller requests as i get more time to play around with the demo..

    i find that the unity web player crashes my imac 27 late 2012 8 gb ram 1gb 675gtx card on 10.8.5 on firefox everytime
    same on my macbook pro

    arghgh
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    I fixed the sliding on a slope bug on the web player. I plan on submitting this update to Unity sometime next week with the movement fixes.

    If you have any suggestions for gameplay/control improvements I'd love to hear them.

    You're the first person that I've heard that has had a crash with the web player version. Is it after anything in particular? Not that this helps your case at all, but I've ran the web player on multiple machines between Mac/Windows as well as on different mobile devices and I haven't seen any crashes. In fact I am surprised it crashes at all, normally if there is an exception it just stops executing that part of the code and doesn't crash. The web player has been built with Unity 3.5.7 so I may need to start uploading it with the latest version of 4 just to be sure it gets all of the fixes on the Unity side.
     
  3. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Thanks for the info re the shader info. Would realyl like it as a feature request (probably don't have time here to do it myself)

    Sorry - beginner question here: I have created a new platform and new scenery object, and assigned them both to the Infinite Objects lists (ie 1 element only for Platforms list and one element only for Scenes list). However I get "unable to spawn platform. No platofrs can be spawned based on probability rules.

    Fo the platform I have Occur Probability set to distance 0-end and probability 1. For scenery I have Occur set to the same (ie 0 to end etc.)

    I should point out that I did cheat and use one of the existing prefabs as a starting point. (so I can't think of any missing elements)

    I will just start afresh for now, however any idea on what I have messed up would be greatly appreciated.

    thanks
    Mathew
     
  4. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, The sections issue is still unsolved. I figured out where the error is happening. Please do like this. Import the package in a new project [I will sen u the package in PM], check the infinite objects script for all the elements added. You should see something like this.
    $Screen1.png
    Run the game in editor, make sure that the character 1 is selected, everything works fine in the first run. Please do a complete run to pass all the four different areas[notice the 3d text]. After that hit on some obstacles and let the player die, now go to store and select the second character and start the game. Now you could see the log after some distance like "unable to spawn platform. No platforms can be spawned based on probability rules". If not try running again and again by changing the characters. One more thing I found is when u select the the character and hit back an error appears like "MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it." After this error the moving obstacles stays at its position and become static. Please help
     
    Last edited: Sep 21, 2013
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    @frak - It sounds like things should be setup properly. Does that error happen instantly?

    @Dharma_raj: Thanks for letting me know about those bugs. I'll PM you a new version of all of the scripts (it will also have some changes that I haven't submitted yet). The problem with the sections was that they wasn't being reset completely. The transform error was because the moving obstacles weren't recognizing the new character.
     
  6. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Yes it was instant. Since I started with the new version it has not happenned though.
     
  7. code749

    code749

    Joined:
    Jan 17, 2009
    Posts:
    100
    ok this is one is more of a design issue but i wonder if anybody else has experienced this

    in the current webplayer demo
    if i jump just before a decline i can go through the roof

    the design fix would be to make the roof higher

    nice fix on the slide on an incline..i tried it so many times and the player would start the slide but then 'get up' on the incline

    good job

    the turning is not smooth though .it is quite jerky and abrupt

    anyway to fix that?

    would a turn left /right animation work??
     
  8. code749

    code749

    Joined:
    Jan 17, 2009
    Posts:
    100
    can you please include option to switch and or equip weapons
    1-projectile weapon
    2-hack/slash weapon
    3-shield

    purchase upgrades on these weapons from the store


    thank you

    should setup a donate button on your site

    so people can contribute to your ongoing efforts

    thank you
     
  9. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi opsive,
    Sections issue was solved!! Great work!! thanks. You are giving a great support to the new developers. Thanks again.

    And I would be more grateful if you help me out on the coins generation part. What happens is, the coins were spawning correctly only on the first cycle after that it is very hard to find it. Do I need to add more coins prefab in the array. Also in the appearance rule I set 0-end with probability 1. I want the coins generation something like running with friends. Thanks
     
  10. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Okay a question re the shader: Looks like I have to give everything the same shader (your custom one for the curves). So things like plants/trees are out as they need a cut-out shader.

    If I DO want to do plants it looks like my options are:
    1 - customise the curved shader of yours to do a cutouts version, and use it for the plants
    2 - turn off the curve shader for everything.

    Are these indeed the only options?

    thanks
    Mahew
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Great to hear. If you are able to get it in the same state as before and want to send me a repro package I can take a look and see what went wrong.

    Yeah, I've seen that. When we first built the starter pack we didn't know that we would be adding height variations to it so the ceilings are short. That said I don't think it will really effect anybody because people will be using their own models anyway.

    That may work. I will play around with it some to see if I can get something that looks smoother (that said, this probably won't be until version 1.4)

    I will add those to the feature request list.

    Thanks for the offer. I really appreciate it. I'm happy to fix any bugs immediately and for any new features I add it to a list then I work on the ones that I think would benefit the most amount of people. That said, I worked out a deal with somebody who contacted me and wants some features sooner than I otherwise would have added them. Other than that, leaving a review on the asset store page really helps as well.

    Are you still working with the same project that you sent me yesterday? I still had it saved off so I just loaded it up to see if I could see any problems with the coins respawning. From what I can tell it all looks ok. The coins have a 90% chance that they won't occur so based on that probability there could be some long stretches where you don't see any coins.

    Yes, unfortunately those are your only two options. The shader is written in Cg so if you have another Cg cutout shader it should be really easy to modify. I can send you a PM with instructions on how to do that. If the shader is not Cg then you are first going to have to rewrite it to Cg and then add the modification.
     
  12. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    No I am not working on that project, in that I could see the occur probability has set to be 1 and no occur as 0.9. In my project I set only the occur probability as 0.9 and no occur probability as 0.1.

    I had done a quick test on that project which I sent you yesterday. Please set the probability rules as 0.9 and 0.1 and do a quick test in that. you could see the coins in the first run. Restart the game and see, now there would be only few coins spawning not as in the first run.
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Thanks, I was able to reproduce the problem with your steps. It looks like the bug was exclusive to Unity 4 (I really can't wait until I can drop support for Unity 3, 99% of the code is the same but with the setActive change I miss things like this). The coins were spawning but they weren't being activated properly. I'll PM you the updated file.
     
  14. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    From time to time i notice glitches where the player walks through the stairs, or the scene objects go up a level but the platofmr objects stay on the same level. I was thinking it was something I was doing but I just reimported and got the both of those happenning in the standard build. I am on the latest Unity 4.

    Can't give you any info to reproduce except just keep playing...

    Also found on the outdoor area if you turn too early you collide with the wall but don't die or stop moving forward (or in this case left or right down the scene)

    Suggestion: when we get an error about not being able to spawn, etc, the message should tell us what it was trying to spawn - will make it MUCH easier to fine out what it is trying to do - in which case what we have screwed up.

    if (spawnData.sectionTransition) {
    print("Unable to spawn platform. No platforms can be spawned based on the probability rules - section"
    + spawnData.section.ToString());
    }else{
    print("Unable to spawn platform. No platforms can be spawned based on the probability rules - transition: "
    + spawnData.prevSection.ToString() + "/" + spawnData.section.ToString() );
    }


    thanks,
    Mathew
     
    Last edited: Sep 23, 2013
  15. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Thanks for letting me know - I'll let God Mode run in Unity 4 for awhile and see if anything weird happens. The going through the stairs problem is probably a simple fix by just expanding the collider of the stairs.

    Already fixed :) It will be in version 1.3.2.

    The only time you see the not being able to spawn an object error is when it is trying to spawn a platform. All of the collidable objects and the scene objects are optional so it moves on if it can't spawn one of those type of objects. You can't really output a specific platform that it is trying to spawn because at that point it doesn't know which type of platform it is trying to spawn - it is trying to just take whatever platform it can that works with the appearance probabilities/rules and sections. Though I did just add more details to the error with the distance and the section info.
     
  16. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Maybe you missed my edit. I put in my own code in that section for expanding on the spawn attemp to dump out the section numbers. Sounds like you have just done something similiar though...
     
  17. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, The coins issue was fixed now!! I never thought it was due to unity version. With the appearance probability set as 1 I am able to see tons of coins down the track. Great fix!! Thanks
     
  18. Hala

    Hala

    Joined:
    May 13, 2013
    Posts:
    31
    I was wondering how to make a particular obstacle appear on one spawning position, for a example, I have a gate obstacle and I only want it to spawned in the centre whenever it appears while still having the rest of the obstacle appearing on all spawning positions.
     
  19. Hala

    Hala

    Joined:
    May 13, 2013
    Posts:
    31
    I have the same problem.
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Yep, I did something similar. On the scene height vs platform height issue I've been able to reproduce it less than 1% of the time.. I am still trying to figure out what it is. As soon as I get that figured out I'll submit a new version.

    Currently there is no rule for that. You're the third person that has asked for this though and it will definitely make it into the next feature release. In the meantime, the temporary work around is to use platforms to control where the obstacle can spawn. Create a platform that only the one obstacle can spawn on top of (by having all other objects avoid the platform). On that platform set the collidable center spawn to true. Now that only that one obstacle can spawn in the center position of that single platform. Not the most elegant way but it will work for now.

    I'm looking at your project now and will email you the fix location at the same time I reply to that

    Edit: @Mathew: I think I found the height bug! I ran the project to a score of 10,000 without any problems at all. I'll PM you the files to see if you think it is fixed.
     
    Last edited: Sep 24, 2013
  21. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive.
    I am creating curved array of coins that appears down the track with an obstacle. For doing this I put an obstacle object within the coins prefab, Is this the only way of getting curved coins? I was also wondering about aligning the coins array corresponding to the obstacle ahead. i.e the coins prefab is always straight and it can be able to become curve while detecting an obstacle collision in its direction. Also you can see in running with friends the stars shifting its lane when an obstacle found in its path.
    $images.jpg $running-with-friends-ios1.png

    Any suggestions? I hope it would be a good addition to your package.

    Thanks
    Dharma
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    I think that you have the right approach of combining the obstacle and coins together into one prefab. In fact I don't think there really is a better way than that. I've gotten a number of requests to have more control of where collidable objects are placed on the platform so I will be working on that for the next feature release
     
  23. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Thanks. I will let you know if I see that problem recurr with the updated file.
     
  24. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive. Hope things are going well there. I need a suggestion from you. I want a continue option when the player dies by paying some coins to get second chance to run from where he dies.
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Hey Dharma_raj -

    When the player collides with an obstacle or wall, gameOver is called on the GameManager. Since you don't want it to necessarily be over, I would create a new method which shows a new gui screen that asks if the user wants to continue. If the user doesn't want to continue you would then call the normal gameOver method like it has in the past. If the user does want to continue you could call continueGame which would look something like:

    Code (csharp):
    1.  
    2. public void continueGame()
    3. {
    4.     dataManager.adjustTotalCoins(/*coin cost to continue game*/);
    5.     playerController.continueGame(); // do you readjust the collision count?
    6.     guiManager.showGUI(GUIState.InGame); // would need some more logic within showGUI to do the animations manually
    7. }
    8.  
    Hopefully that gives you enough of an idea on how you would approach that. I am currently working on the next version so I will add this as a feature if I get enough time.
     
  26. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, thanks for the help!!
    Can you tell me how to decrease the time taken for jump. Currently the player lands very slowly which is not synced with the player movement. The character should jump up and lands immediately down. I tried increasing the mass of the rigidbody and jumpforce but failed. Please help
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Mass doesn't affect how quickly objects fall to the ground. Jump force will adjust how high the player jumps but it also doesn't affect how fast the player falls to the ground. There are two ways to make the player fall faster: increase gravity (Edit->Project Settings->Physics->Gravity) or apply a downward force when the player is in the air. To do this add the following variable to the top of PlayerController.cs:

    Code (csharp):
    1.  
    2. public float jumpDownwardForce;
    3.  
    Then replace the FixedUpdate with:
    Code (csharp):
    1.  
    2.     public void FixedUpdate()
    3.     {
    4.         float yForce = (isJumping ? jumpDownwardForce : -5);
    5.         thisRigidbody.AddForce(0, yForce, 0, ForceMode.VelocityChange);
    6.     }
    7.  
     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Version 1.3.2 was approved by Unity yesterday. It contains the following fixes:

    • Sections weren’t being reset properly
    • The scene object height will always match with the platform object height
    • Prevent sliding while on a slope
    • Coin objects work with optimizeDeactivation
    • Recursively deactivate/activate collidable objects in Unity 4
    • Sections weren’t properly being remembered throughout the different object locations
    • Don’t move the infinite objects forward if the player turned over a non-turn platform
    • Added larger colliders to the stair scene objects
    • Renamed updateNotes.pdf to release notes.pdf (you can delete updateNotes.pdf)
     
  29. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Great to hear!! Very useful updates
     
  30. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, Tell me whether it is possible. I want the path to be narrow with only two lanes in some areas, i.e one lane would be completely covered with giant rocks and trees.(Every running game has this, even two lanes can be covered) If I create a scene object with the giant obstacles(say mountain) and add it to the first section, will it works? I want it to be appear for some 50 meters. I was wondering that whether the probability rule will allow to spawn same scene object continuously for some period or not. Since it randomly generates the environment, it may not appear continuously for some distance. In detail, I have A, B and C scene objects assigned to be appear on section 1. C is the object which has only two lanes(No change in platform width). I want the scene objects to be ordered like A, B, A,A,B, C,C,C,C, B, A..... C,C,C,C... to the next section. Hope you got it.

    Edit: See also if this idea works. Creating a platform object and scene object triple the length of the normal objects length. My platform's length is 15, If I model a platform with 45 units, will it occur properly between two normal length platforms?

    Edit: Image reference
    $Agent-Dash-Level.jpg
    $images (2).jpg
     
    Last edited: Oct 1, 2013
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    There are two different ways you could approach this. The first is similar to what you described: create a scene that has the hazard and assign a particular platform to always spawn with that scene to make the art flow. Then assign them within their own section. The infinite object generator will keep spawning this particular scene and platform until the section is over. You shouldn't have any problems with this appearance rules or probabilities in this regard.

    The second approach to it is to block off a lane with an obstacle. You could then have the obstacle behave like a wall and kill the player if they run into it. In your top image I'd use the first method and the second method for the bottom image.

    ----

    Two things unrelated to the above post:

    1. There is a bug that causes a compiler error on iOS/Android. It is a simple fix and I have already submitted it to Unity. In InputController,cs, change line 81 to:
    Code (csharp):
    1.  
    2. if (playerController.abovePlatform(true)) {
    3.  
    Instead of
    Code (csharp):
    1.  
    2. if (playerController.aboveTurn()) {
    3.  
    This bug was introduced in version 1.3.

    The second thing is that I've finished implementing a new 1.4 feature: ability to specify slot positions on the collidable object.
    $coin.PNG

    This has probably been the most popular feature request recently. I'm not done testing it but if anybody wants this code within the next couple of days let me know.
     
  32. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi!! Thanks for the reply! I will implement the idea and see.

    I really want the slot positioning option. Will this work with obstacles too? Please send

    Edit: Please do something with the obstacle occurrence in the platform right next to the turn platforms. When the player turns on a turn platform there is an obstacle spawned which makes the player die since he has no time to escape. The obstacles must be spawn some distance away from the turn platforms.
     
    Last edited: Oct 2, 2013
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    No problem, I'll send it as soon as I get done testing. Yes, this will work for obstacles as well (any object derived from collidable object will benefit, so coins, obstacles, and power ups).

    Good idea for preventing obstacles from spawning right after a corner, that should be easy to implement.

    Edit: done testing, sent you a PM with the link to the scripts. Let me know if you have any problems.
     
    Last edited: Oct 3, 2013
  34. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Great!! It works well!! But I haven't tested it on my working project since I edited some scripts over there. So please tell me instead of importing all the scripts, which scripts should be updated to get this feature done.

    Is this package also contains the obstacle prevention code right after a corner? If no, please tell me how to implement?

    Thanks
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    The following files were affected:

    /Assets/Infinite Runner/Scripts/InfiniteGenerator/AppearanceRules.cs
    /Assets/Infinite Runner/Scripts/InfiniteGenerator/CollidableAppearanceRules.cs
    /Assets/Infinite Runner/Scripts/InfiniteGenerator/InfiniteObjectGenerator.cs
    /Assets/Infinite Runner/Scripts/InfiniteGenerator/InfiniteObjectManager.cs
    /Assets/Infinite Runner/Scripts/InfiniteObjects/CollidableObject.cs
    /Assets/Infinite Runner/Scripts/InfiniteObjects/PlatformObject.cs

    The package does not contain the code to prevent obstacles from spawning right after a corner. I briefly looked into it and the infinite object history isn't saving as much as I thought that it did to make it a one or two line addition. I will let you know when I have it done.
     
  36. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Cool. Thanks!! The slot positioning works well in my project.

    Hi I found an issue in obstacle spawn, I have three types of obstacles A B and C. A should be appear very hardly, B with medium spawn and C frequently. To get this for obstacle A, in its collidable appearance rule I set Avoid object - Use Min distance with same object type - Min Distance 25. In Infinite object manager I used only this obstacle and tested. I works well by keeping a distance between each Aobstacle. Now set B's rule as Use min distance with same object type - Min distance 10. Added the B obstacle to infinite objects manager. This is where the problem occurs, I don get the obstacle spawning correctly. I want to add C as well. please help.
     
    Last edited: Oct 4, 2013
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Sorry I didn't see this post until now (saw the first part initially but didn't get an email for the edit).

    Generally speaking, if you want an obstacle to occur less frequently than another obstacle, you should adjust the appearance probabilities rather than the appearance rules. Appearance rules are more for controlling the separation between objects or adjusting the appearance probability based on another object that has already spawned.

    That said, they should still work. What do you mean the obstacles don't spawn correctly? Here's what I tested with:

    1. Import package off of asset store
    2. Only allow the chair jump and the chandelier duck obstacles to spawn
    3. Adjust the appearance probability of both so they have an equal chance of occurring
    4. Add an avoid object rule to the chair. I set the min distance to 20 and checked the box to use the minimum distance for the same object type
    5. Add an avoid object rule to the chandelier. I set the min distance to 10 and checked the box to use the minimum distance for the same object type
    6. Hit play

    Both the chair and the chandelier spawn, with distances that look correct (I didn't verify it in code)
     
  38. Chris_E

    Chris_E

    Joined:
    Jul 10, 2012
    Posts:
    32
    There's a lot of pages here, so sorry if this was asked before and I missed it... but can you use non-lane type of movement? Like tilt to move a-la some popular endless runners?
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Currently there isn't a way. I am actively working on the next feature release and I will make sure it gets in the next release. I will send it to you as soon as I get it implemented. At the very worse case, I am hoping to submit this release within the next two or three weeks.
     
  40. Chris_E

    Chris_E

    Joined:
    Jul 10, 2012
    Posts:
    32
    Thanks for the fast response. I'll be picking this up as soon as I get a milestone payment! Thanks!
     
  41. Sinhabros

    Sinhabros

    Joined:
    Aug 3, 2013
    Posts:
    15
    How would you add music to the game menu?
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Check your PM, I just sent you the files. There really wasn't many code changes it was just easier to send you the files rather than paste the code blocks here.
     
  43. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi opsive, How the distance is calculated and stored in the game. I want the scores to be in meters, I dont want any multipliers. Also for every xxxx meters I want to give some awards to the player(it will appear on the screen while running). Everything should be related to the distance. Thanks

    Edit: I found it, I guess this is correct.
    //Change in datamanager.cs
    score = PlayerController.instance.totalMoveDistance;
     
    Last edited: Oct 8, 2013
  44. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, I want to change the input controller for IOS since a single continuous swipe changes the character's position twice. i.e if I swipe while the character is on Left lane, it changes its position to centre and also reach the right lane. What I need to have is, one swipe even it is longer or shorter, it should shift the player only one lane left or right.

    I tried changing the touch.phase to Ended,
    .....else if (touch.phase == TouchPhase.Ended) {
    Vector2 diff = touch.position - touchStartPosition;......

    but it works only when i removed the finger from screen. Please help.
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    For your first question, the solution that you posted will work but here is a more 'correct' way of doing it:

    Add the following to the top of InfiniteObjectGenerator.cs:
    Code (csharp):
    1.  
    2.     private DataManager dataManager;
    3.  
    And get a reference to the data manager within start (similar to how the infiniteObjectManager/History works):
    Code (csharp):
    1.  
    2.         dataManager = DataManager.instance;
    3.  
    Then within moveObjects, replace the block within the if(!stopObjectSpawns) to:
    Code (csharp):
    1.  
    2.         if (!stopObjectSpawns) {
    3.             dataManager.addToScore(moveDistance);
    4.             spawnObjectRun(true);
    5.         }
    6.  
    Finally, within the data manager, remove the "startTimer" method and all calls to it. You can also remove the scoreMult variable. Then add the following method:
    Code (csharp):
    1.  
    2.     public void addToScore(float amount)
    3.     {
    4.         score += amount;
    5.         guiManager.setInGameScore(Mathf.RoundToInt(score));
    6.     }
    7.  
    I actually like this change so I will put it in the next update. As far as the dialog that appears, you'll have to create your dialog within the scene and then animate it similar to how the rest of the menus are animated. You can then display it when the player reaches the award.

    As far as your second question, I haven't tested it but you should be able to do something like the following:

    Add the following variable to the top:
    Code (csharp):
    1.  
    2. private bool hasTouchEventOccurred;
    3.  
    Within startGame() set this to false.

    Then instead of (within the UNITY_IPHONE || UNITY_ANDROID block, around line 65)
    Code (csharp):
    1.  
    2. } else if (touch.phase == TouchPhase.Moved) {
    3.  
    Do:
    Code (csharp):
    1.  
    2. } else if (touch.phase == TouchPhase.Moved  !hasTouchEventOccurred ) {
    3.  
    Within that same block add
    Code (csharp):
    1.  
    2. hasTouchEventOccurred = true;
    3.  
    Finally, within the touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled block of code reset the value:
    Code (csharp):
    1.  
    2.                 if ((touch.position - touchStartPosition).sqrMagnitude < 100  !hasTouchEventOccurred ) {
    3.                     playerController.attack();
    4.                 }
    5.                 hasTouchEventOccurred = false;
    6.  
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Unity just approved the latest version of the starter pack. This release only contains the iOS/Android fix described here. The next feature release is coming along well and I hope to have it submitted within the next couple of weeks.
     
  47. Chris_E

    Chris_E

    Joined:
    Jul 10, 2012
    Posts:
    32
    Curved Vertex Transformation Shader question: I notice that it makes it look like the level is always curving to the right. I've seen some games where it looks like it's always curving in an arc in front of you (example: Ninja Slash: http://www.kongregate.com/games/doopop/ninja-slash) Is that possible with this shader? If not, is it possible to periodically switch from left to right, and turn the shader on/off to give an illusion of the level having more variety... or would that be too complicated?

    Edit: I tried to edit this once, but the changes were lost. Upon further inspection it appears the arc is just an illusion and both are actually curving to the left.

    This leads to a further question of if it would be possible to adjust the amount of the curve? So sometimes it's a slight curve, and sometimes it's more steep. I'm thinking adding a trigger to make a change to the shader every time you hit a hard turn, since you can't really see the effects of the shader when the world is so close to the player.
     
    Last edited: Oct 10, 2013
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    Yes, it does look like Ninja Slash has a left curve versus an arc. However either one is possible with the shader included. For example, take a look at this image:

    $curve.PNG

    the curve is now facing down instead of to the right. For this I modified the platform and infinite objects materials to specify a value of 15000 for the y near curve and a value of -60 for the y far curve. You can play around with these values to get the exact curve that you are looking for. It would also be possible to adjust the amount of the curve based off of a trigger. For that you would keep a reference to all of the materials that use the shader, and when you want to change the value with Material.SetVector (http://docs.unity3d.com/Documentation/ScriptReference/Material.SetVector.html).
     
  49. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    I want to show a specific obstacle once for every 500m. For that I tried added that obstacle object in the transition scene itself (section 0-1, 1-2,2-3...) it works. But It is not a proper way to get this. And also in this approach I can only able to show one kind of obstacle on that platform. I have different types of special obstacles which should be randomly occurs for every n distance. Any suggestions?

    thanks


    Edit: One more issue in the sections transitions. PM sent
     
    Last edited: Oct 11, 2013
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,099
    hmm.. there is no direct way to do this but what you could do is use the appearance rules to simulate this. Setup a probability adjustment rule that has a min distance of 500. Then make the probability adjustment field a really large number such as 100000. What this will say is that for every 500m, the object that is affected by the probability adjustment rule will have a 100000 more likely chance of spawning versus any other object. Yes, there is a very very small chance that a different object may spawn in its place but that will basically never happen.

    Edit: Forgot to mention, you'll also need to setup an avoid object rule on this object to prevent it from spawning within the 500m.

    I was looking back at your post asking about preventing objects from spawning after a turn (here). I thought about it some more and you can do it already with appearance rules. Setup a rule on each obstacle to have a target object of the turn and a minimum distance of whatever length you want. This will prevent objects from spawning shortly after a turn.
     
    Last edited: Oct 11, 2013