Search Unity

Infinite Runner Starter Pack

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

  1. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm thinking about purchasing this kit and merging it without another kit -- but the latter requires that the player-character move. I understand why Infinite Runner has the PC remain stationary and everything moves around him, but would it be simple/difficult/insane to modify the game so the PC moves through the stationary environment?
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    It should be relatively simple. The biggest thing that you would have to change is how the Infinite Object Generator determines that it needs to spawn more objects. In the current implementation it makes this decision based off of the position of the last object spawned. If the objects don't move because the player is moving you wouldn't be able to use this position to determine when the next object should spawn. Instead I think the easiest thing would be to keep track of the distance that the player moved, and spawn more objects when that distance gets past some threshold. Other than that you would have to comment out some code to prevent the objects from moving and add forces to the player to do the moving.

    If you do end up purchasing the starter pack I would hold off until the next version comes out before you start to make changes. I have made some pretty big updates to the Infinite Object Generator in order to support curves so that would conflict with the changes that you are going to need to make. I am hoping to be able to submit this update the week of the 20th and then it takes Unity about a week to approve things.
     
  3. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi opsive, I sent u a PM contains the sample project which has the same assets of your project. In each transition section I added 3d texts with specific name and colour. Please do the following. Run the game - in the first run you could see all the transition objects appears correctly - now make the player die - restart - now see you could not see any transition object that has to be spawn between section 0 and 1. This is the section setup in infinite objects. $inspector.jpg
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    That sounds pretty straightforward. Thanks much!
    Dave
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Yeah, I don't think it will be too bad. If you need any help feel free to let me know.

    @Dharma_raj - thanks, I'll take a look at it and send you a PM with the fix.

    Edit: PM sent, a really quick code change. For anybody else, the fix is to change line 405 and 406 of InfiniteObjectHistory.cs to:

    Code (csharp):
    1.  
    2. spawnedSceneSectionTransition[i] = false;
    3. spawnedPlatformSectionTransition[i] = false;
    4.  
    Instead of setting these two variables to true.
     
    Last edited: Oct 14, 2013
  6. veryayskiy

    veryayskiy

    Joined:
    Oct 9, 2013
    Posts:
    1
    Hello,

    I purchased the pack and I really like how it works. I've some questions (sorry I didn't find answers in the tread):
    1. I want to increase the speed when a character is jumping. So it's temporary increase while jumping is going. How I can do it?
    2. The same as first thing. I want to reduce the speed when a character is sliding. How I can do it?

    Thank you!

    P.S. I'll ask many questions in future, sorry :)
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hello,

    I'm happy to help :) Questions 1 and 2 are similar so I'll just group them together in the code blocks.

    Add the following to the top of PlayerController.cs:
    Code (csharp):
    1.  
    2. public float jumpMoveSpeed;
    3. public float slideMoveSpeed;
    4.  
    Then within Update(), replace
    Code (csharp):
    1.  
    2. float forwardSpeed = forwardSpeeds.getValue(totalMoveDistance) * Time.deltaTime;
    3.  
    with
    Code (csharp):
    1.  
    2. float forwardSpeed = Time.deltaTime;
    3. if (isJumping) {
    4.    forwardSpeed *= jumpMoveSpeed;
    5. } else if (isSliding) {
    6.    forwardSpeed *= slideMoveSpeed;
    7. } else {
    8.    forwardSpeed *= forwardSpeeds.getValue(totalMoveDistance);
    9. }
    10.  
     
  8. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hey there, How are you Opsive? I recently bought your plugin. You did a great job, it has helped us reducing the production time required to make a running game. I was wondering if I was doing something wrong, our game crashes after few minutes of gameplay. It gives

    NullReferenceException: Object reference not set to an instance of an object
    InfiniteObjectGenerator.moveObjects (Single moveDistance) (at Assets/Infinite Runner/Scripts/InfiniteGenerator/InfiniteObjectGenerator.cs:439)

    error. Right now we just have straight path. I play in GodMode so i am not even obstructed. It usually happens around 4k score. Your help would be highly appreciated please.

    Another thing, Powerup do not generate, do I need to enable any settings to make them spawn? I have not changed any settings for those from the starter kit.

    Thank you,
    Mustafa D.
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hi mustumasti,

    Thanks for your purchase, glad you are enjoying it.

    For the first error, can you list the steps that I need to take in order to reproduce it? Or send me a repro project?

    For the power up question, have you purchased the power up from the store? They will only spawn if they have been purchased.
     
  10. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hello Opsive, Thank you for quick reply. You were right, I had not purchase the powerup thats why it didnt spawn.

    I tried reproducing the same error on your starter project, but it did not work. I removed all platforms except straight and let run for 10 mins. It did not crash.

    But our project crashes in few minutes. It generates properly scenery and platforms for few minutes, then all of sudden it stops producing anything and crashes the game. I dont know how to show you.
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Great to hear about the power ups. For the null reference issue, can you send me a sample project that has the problem? You can export it as a unity package file and then email it to me (or upload it to dropbox if it is too big). My email is support@opsive.com.
     
  12. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, The sections problem has gone, thank you so much!!

    Edit:Can you give any suggestion on how to shake the camera while stumble?
     
    Last edited: Oct 16, 2013
  13. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hello Opsive, which would be the best way to enable PowerUp on first start of the game. Like "Character 0" is always available to the player. I would like PowerUp Magnet always available to players, they do not need to purchase to unlock it.
     
  14. Chris_E

    Chris_E

    Joined:
    Jul 10, 2012
    Posts:
    32
    I'm guessing the answer is no because of the way the procedural generation of the game works... but can light probes work with this kit? I haven't worked with them before, so I don't know how they work exactly. I didn't even know you could use light-maps with prefabs, so this is all kind of new to me.
     
  15. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hello Opsive, for some reason the coins attract towards the player twice when coin magnet is active. It seems like the coin resets its position to its previous position. I checked the scripts and tried making few changes but it did not work as intended. Could please help me correct it.
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @Dharma_raj:
    Sure, you'll find within PlayerController.obstacleCollision that it starts to stumble. Within this method you could call a camera method that does the shaking. This code provides a pretty good example of what the shake method would look like: http://answers.unity3d.com/questions/212189/camera-shake.html. Instead of being within the Update method I would place the shaking within a coroutine instead since shaking doesn't need to be updated every frame. You can then pause/stop the shake when the user goes to the pause menu similar to how the stumble is paused within the player controller.

    @mustumasti:
    For your first power up question, in DataManager.Start() you'll find
    Code (csharp):
    1.  
    2. purchaseCharacter(0);
    3.  
    Underneath that add the following:
    Code (csharp):
    1.  
    2. if (getPowerUpLevel(PowerUpTypes.CoinMagnet) == 0) {
    3.    upgradePowerUp(PowerUpTypes.CoinMagnet);
    4. }
    5.  
    This will always enable the first level of the CoinMagnet power up

    I am unable to reproduce the problem that you are having with the second question. I tried on the default starter pack as well as the project that you sent me earlier. In the project that you sent me earlier I noticed that you are doing a gameObject.SetActive(false) immediately after the coin is collected. Instead of calling SetActive call collidableDeactivation() so the object pool can reuse the object. Maybe that was it?

    @Chris_E:
    Yeah, it's pretty cool how the lightmapping can work with dynamic objects like that. I have never played with light probes personally but I suspect that it will work. The probes bake into the same lightmap data so if regular lightmapping works then I suspect that the light probes work as well. I am going to be using light probes extensively in the current game that I am working on so I will have a better answer after I start playing with them.
     
  17. ipk77

    ipk77

    Joined:
    Oct 17, 2013
    Posts:
    6
    Hi Opsive, thank you so much for this pack; it truly helps a lot. I have a question in regards to coin generation. My current problem is not being able to generate coins on or around specific obstacles or avoid generating where there are specific type of obstacles. For example I am trying to generate my coins on top of the "water tank" obstacle but at the same time I don't want any coins around my "table obstacle". I assume that I need to work around "Collidable Appearance Rules" script to be able to achieve that. However, I am a bit confused about how "min distance", "min object separation" and "use end distance" works. Also, would having a high probability appearance value for coins effect how "Collidable Appearance Rules" work? Because I tried generating coins only adjagent to a specific obstacle but they still get generated where there is no that type of obstacle. I would appreciate your assistance. Thank you in advance.
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hi ipk77,

    Have you seen this video on appearance rules and probabilities? I think that it will help answer some of your questions: http://www.youtube.com/watch?v=2p_5eLrKgvc.

    For some of the questions that the video does not answer: If you want to spawn coins directly on top of an obstacle, all you need to do is add the coin to the obstacle prefab exactly where you want it. Whenever this obstacle spawns the coins will now spawn as well. You would use appearance rules in order to have coins avoid your table obstacle. Appearance probabilities do not effect the appearance rules. However, appearance rules can affect appearance probabilities (such as setting up a probability adjustment rule).

    After watching the video my suggestion would be to just play around with the appearance probabilities/rules to get a feel for how they work. It is probably the most complex feature to understand within the starter pack but they allow you to have a lot of control over how things spawn throughout the game.
     
  19. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hello Opsive, How are you? Thank you for being very quick with your response. I was wondering if I had to make a new PowerUp what would be the procedure for it. Which files I need to make changes to give the same functionality which your current PowerUp have.
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    What type of power up are you trying to add? The implementation depends a lot on the type of power up. However, at the bare minimum you will need to add another PowerUpType enum to the top of the PowerUpManager.cs. Once you've added that you can then create the power up prefab for it, but it won't do anything if collected. Do a search within the code for PowerUpTypes.DoubleCoin, PowerUpTypes.CoinMagnet, or PowerUpTypes.Invincibility for an example on how those are implemented, it may give you enough of a hint on how to implement your own power up type.
     
  21. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Thank you Opsive, that is a very good tip.
     
  22. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    We would like add a Powerup like Double coin, instead of coins it would double the multiplier on score for limited seconds.
     
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    No problem. At the top of PowerUpManager.cs replace the PowerUpTypes with the following:

    Code (csharp):
    1.  
    2. public enum PowerUpTypes { DoubleCoin, CoinMagnet, Invincibility, DoubleScoreMultiplier, None }
    3.  
    Then at the top of DataManager.cs, declare a reference to the PowerUpManager:
    Code (csharp):
    1.  
    2. private PowerUpManager powerUpManager;
    3.  
    And within Start(), set it to the instance:
    Code (csharp):
    1.  
    2. powerUpManager= PowerUpManager .instance;
    3.  
    Finally, within scoreTimer() you'll see:
    Code (csharp):
    1.  
    2. score += (Time.time - prevTime) * scoreMult;
    3.  
    Change that to:
    Code (csharp):
    1.  
    2. score += (Time.time - prevTime) * scoreMult * (powerUpManager.isPowerUpActive(PowerUpTypes.DoubleScoreMultiplier) ? 2 : 1);
    3.  
    In the next version I've changed it so the score is based on the distance traveled instead of the time, but it should be an easy update if you choose to merge with my changes. Also, I had to change the inspector code a little bit in order to get the static data inspector to cooperate with a new enum value. I'll PM a link to the updated file. Note that I didn't actually test this code so let me know if there are any problems :)
     
  24. ipk77

    ipk77

    Joined:
    Oct 17, 2013
    Posts:
    6
    Thank you Opsive! I tried adding the coins to the obstacle prefabs but the coins didn't appear when obstacles were generated. However, attaching the obstacles to the coin prefabs and generating the coins succeeded.
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    If you want the coin to be a child of the obstacle make sure the Coin Object script is disabled within the prefab. When the coin is on its own the script will automatically disable itself after it is activated but activate will never be called if the coin is a child of the obstacle.

    $coin.PNG
     
  26. Chris_E

    Chris_E

    Joined:
    Jul 10, 2012
    Posts:
    32
    I swear this was asked earlier in the thread, but I can't find it!

    My character is moving down somewhat slowly and kind of in jittery steps after a jump. I tried changing the line "thisRigidbody.AddForce(0, -5, 0, ForceMode.VelocityChange);" in fixed update but that didn't seem to affect it. I also tried changing my player's rigidbody mass, but that did nothing.

    How would I make the character fall faster and smoother? I'd be okay with a performance cost for it even.
     
  27. ipk77

    ipk77

    Joined:
    Oct 17, 2013
    Posts:
    6
    Hi again Opsive! I have some enemies moving towards the player, and they function same as obstacles. So the player has to avoid them. However, the enemies go through other obstacles and coins as they run and it looks pretty bad. I tried using the "appearance rules" script to make enemies spawn with a big distance from other the obstacles but it doesn't really work because enemies run fast and they go through the obstacle even before I pass the obstacle. So, I was wondering if there is a way that I can make sure there is no obstacle between the player and the enemy when the enemy gets generated on any lane so that it won't go through anything before reaching the player. Thank you++
     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @Chris_E:

    Is this post the one that you were looking for? I think that should answer your question. The reason why changing AddForce didn't do anything is because that is only for when the player isn't jumping to keep them sticking to the ground.

    Though I haven't see the jittering that you mentioned. Is it an animation problem or physics problem?

    @ipk77:

    That is a good suggestion and right now there is no way to check ahead of time that the moving obstacle won't go through a static obstacle. My suggestion would be to setup a system where you have different sections that only allow moving obstacles to spawn within certain slots. For example, you could have one section where the moving obstacle only spawns in the center and static objects spawn on the left and the right. Then the next section you have moving obstacles on the left or right and static objects in the other slots. You could mix the sections up enough that you could probably get a pretty realistic solution. Nonetheless, I will add this as a feature request and try to get it in one of the future versions. Unfortunately it won't make it into the next feature release as that release is already pretty packed.
     
  29. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Thank you Opsive, we have few additional PowerUp in our game. Your suggestion is definitely helping. Thank you.
     
  30. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hello Opsive, I did what you suggested me to make Double Score PowerUp, but when i made the changes I was getting an error from the Static Data Manager.

    IndexOutOfRangeException: Array index is out of range.

    To my understanding it requires data for Double Score Powerup. Unfortunately, there are no slots for me under Double Score Powerup in Static Data manager, so I removed the script and added it again. Which provided me with new slots to add values to all the powerups. But after when I add them and click to another gameobject, the values reset to zero. Unity is acting strange. Is there an another way to implement it?
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Did you replace the one file that I PMed to you? It should have fixed the IndexOutOfRangeException.
     
  32. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Yes I replaced the files you gave me on that email. I am getting error in StaticDataInspector

    IndexOutOfRangeException: Array index is out of range.
    StaticDataInspector.OnInspectorGUI () (Assets/Infinite Runner/Editor/Game/StaticDataInspector.cs:59)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
    UnityEditor.EditorApplicationLayout:SetPausemodeLayout()
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I sent you a file through the forum's private messaging system, and that should fix the index out of range problem. Line 59 is now a curly bracket. I will email the file to you as well.
     
  34. mustumasti

    mustumasti

    Joined:
    Mar 19, 2011
    Posts:
    14
    Hello Opsive, we are implementing a destructible Moving obstacle which always appears on a specific scenery. We marked it destructible as well as made it a child object of the scene. I have implemented codes to detect if these obstacles are colliding when attacked by a weapon, when they collide then i call the function obstacle.deactivate() [I even tried obstacleAttacked()]

    When I test it, the obstacles spawn on the scene and affects the player if collided. But when I destroy the obstacle with a weapon, it does not reappear on the scene every time. (It appears on the first few scene of similar type but doesn't appear after that)

    I would also like to know if there is a way to make the obstacle move in X direction instead of Z. I tried Horizontal Speed, but nothing happened.
     
  35. ipk77

    ipk77

    Joined:
    Oct 17, 2013
    Posts:
    6
    Thanks Opsive. I am stuck at defining the slots they can/can't spawn for different obstacles. Would you suggest making several platforms, assigning them sections, and using "collidable position selections" and "force different collidable" in the platform object script? I am comfortable with creating sections and assigning them but I am not sure what is the most efficient way to work on the slots distribution.
     
  36. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Three things:
    1. How far away is the "convert to rag doll on death" feature that was requested by somebody a while back?
    2. Can you give me a hint about what I am doing wrong in changing the player character. I have renamed the animations to match the canned animations that came with the animated character, and added the script, etc as directed on the manual. I am getting an IndexOutOfRange on line 85 fo StaticData.cs ( return characterPrefab[character]
    3. FEATURE REQUEST: Been thinking of making the rendering filter that gives everything a curve, so that the curve moves around during game play. Would make it look like you were going up and down hills and valleys and left and right.
    thanks,
    Mathew
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @mustumasti -

    When you want to remove a obstacle, coin, or power up, call collidableDeactivation instead of just deactivate. What code did you add? When the player attacks an obstacle, obstacleAttacked should already be called either through PlayerController.attack() or in your case it sounds like you are using a projectile so ProjectileObject.OnTriggerEnter(). You said that you made it a child object of the scene, are you saying that you made it a child object of one of the scene objects that gets spawned? In that case the object manager doesn't know anything about the moving obstacle object so when that object gets deactivated through collidableDeactivation it is going to stay deactivated and never spawned again. You need to add the object to the obstacles list within the Infinite Object Manager, and use the rules to ensure the moving obstacle only spawns on top of the correct platforms/scenes.

    horizontalSpeed is only used if moveTowardsPlayer is enabled. This moves the object directly in front of the player. However, if you want a constant horizontal speed all you have to do is remove the the moveTowardsPlayer block within MovingObstacleObject.Update():
    Code (csharp):
    1.  
    2.    if (moveTowardsPlayer) {
    3.    ...
    4.    }
    5.  
    and change FixedUpdate() to include deltaForce.x:
    Code (csharp):
    1.  
    2. ...
    3.         Vector3 deltaForce = Vector3.zero;
    4.         deltaForce.x = horizontalSpeed;
    5.         deltaForce.y = -3;
    6. ...
    7.  

    @ipk77 -

    I do recommend assigning the different platforms to sections but collidable positions / force different collidable objects isn't going to help you. I'll PM you the new files for a new feature in version 1.4 which allows you to specify which slots obstacles can spawn on top of. This will make life easier. With those files, here's what I would do:

    Assume that you have two obstacles (obstacleStatic and obstacleMoving).

    1. Create a prefab of obstacleStatic, assign it to section 1. I'll call this obstacleStatic1.
    2. Create a prefab of obstacleStatic, assign it to section 2. I'll call this obstacleStatic2.
    3. Create a prefab of obstacleMoving, assign it to section 1. I'll call this obstacleMoving1.
    4. Create a prefab of obstacleMoving, assign it to section 2. I'll call this obstacleMoving2.
    5. With the new 1.4 feature, set obstacleStatic1 to only be able to spawn in the center slot
    6. Set obstacleMoving1 to spawn in the left or right slot
    7. Set obstacleStatic2 to spawn in the left or right slot
    8. Set obstacleMoving2 to only spawn in the center slot

    With this setup, you can alternate the sections and it will prevent moving objects from colliding with static objects. You may have to have a small buffer section depending on how faster the player moves in order to ensure the section 1 moving obstacles don't collide with section 2 static obstacles, and the other way around.

    Edit: The forum won't let me send you a PM. Can you email support@opsive.com with your email address so I can send you the files?

    @frak -

    1. I add features based on the amount they are requested as well as the time that it would take to implement (and how well suited I think that particular feature is for a general starter pack). I still have rag doll on death on the requested features list, but it may not be for the next couple of feature releases. I've never used rag dolls but from what I've seen it isn't the coding that is so bad, it is the modeling. Starting next week I will be working full time on creating assets while my artist still has a day job, so it takes longer to do things on that side of things. I can look into it and see what it takes to convert to a rag doll code-wise, but I won't have a model to test with.
    2. Did you add the character prefab to the static data component (found under the "Game" game object)? This is the last step in that list.
    3. Added, so basically a shader that moves the curve in different directions?
     
    Last edited: Oct 20, 2013
  38. Hala

    Hala

    Joined:
    May 13, 2013
    Posts:
    31
    How can I make the shader in this pack to accept lighting?
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Check your PM
     
  40. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Re the shader I was just thinking of using global vars for all the instances of the shader - then you can change those vars and effect all instances of the shader at once.

    And yes I added the character to the Characters selection to get this error.
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    For the character problem, either set a breakpoint or output a log message within getCharacterPrefab to see what index it is trying to access.
    Code (csharp):
    1.  
    2.     public GameObject getCharacterPrefab(int character)
    3.     {
    4.         printf("Character Index " + character);
    5.         return characterPrefab[character];
    6.     }
    7.  
    Then go to the static data component and make sure your prefab is set for that index. If you switch the inspector to debug mode you can see the raw array contents. Scroll down to Character Prefab and make sure the index has a prefab attached.

    And for the shader idea, that does make it easier to change the value, good suggestions.
     

    Attached Files:

    Last edited: Oct 20, 2013
  42. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Interestingly enough, it was calling with character value of 1. (I only have one character).

    So the coding 0 meant it did select the only character available. Prior to this I did try just adding the character to the end of the list, however it never selected the character.

    So I hard coded the value to 0 but getting some other strangeness. (Camera is at ground hight instead of chase cam and character stops moving half way up the first set of stairs.
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    You shouldn't have to hard code it. Could the value of 1 be coming from which character was selected? The player prefs could be saving that value from when there were two characters included and now since you only have one it is trying to reference a character that doesn't exist. The easiest way to clear out the player prefs is to place PlayerPrefs.DeleteAll() within GameManager.Start(). Play it once and then remove that line. You should now have a completely clear player prefs.

    As far as the other strangeness, I bet the camera position is due to Camera Position on the PlayerControl being set to all zeros. You can change the camera position/angle per character but it has caused more confusion than anything else so I plan on removing that variable. For the character stopping, I am not completely sure on that one. The first thing that I would check is to see if InfiniteObjectGenerator.moveObjects() is receiving a value for moveDistance greater than 0. If it equals zero then chances are the forward speeds are setup correctly on the PlayerController and it was just a coincidence that the player was over the stairs at the time that he quit moving.
     
  44. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    I think it is okay if the "how to" document reminded us that the settings for camera existed. Though maybe a default in 'Game' with an optional override would be sensible. (I really don't think most people would have a need fo individual cam settings per character but you never know)

    As for the freeze when everthing stops spawning/moving - the stairs was a coincidence. Will see what I can work out here... Maybe missing a speed setting(?)
     
  45. frak

    frak

    Joined:
    Feb 8, 2013
    Posts:
    45
    Okay maybe a character example with multiple speeds would be a good idea.

    This is what caused the issue:
    distance 0-50 - speed x
    distance 51-500 - speed 7

    Where as they need to overlap. Changing my 51 to a 50 got thigns unfrozen.
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Glad to hear that you got it working. I'll update the doc to include the reminder about setting the camera position (better yet, I'll hurry up and submit the next version which will remove that requirement).
     
  47. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hi Opsive, How can I add Sections to moving obstacle objects? I want the moving obstacles to be appear in selected sections. I dont want to use avoid platform method, because my game has many platforms.
     
  48. Hala

    Hala

    Joined:
    May 13, 2013
    Posts:
    31
    Thank you.

    when it comes to changing slots ( swiping option), when I swipe the player is most likely will end at the far right or the far left and rarely at the center position which I believe is the mathf.clamp function fault. I tried adjusting the swipe sensitivity value, but still It will most likely end up on the right or the left .. Is there a way to make the swiping more accurate?
     
  49. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @Dharma -
    The functionality is already there, I just forgot to create an inspector script that exposes it. Create a new file named MovingObstacleObjectInspector.cs that includes the following:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4.  
    5. /*
    6.  * Custom editor insepectors don't support inheritance.. get around that by subclassing
    7.  */
    8. [CustomEditor(typeof(MovingObstacleObject))]
    9. public class MovingObstacleObjectInspector : CollidableObjectInspector
    10. {
    11.     // Intentionally left blank, use the parent class
    12. }
    13.  
    Place this file in the Editor/InfiniteObjects folder.

    @Hala -
    I don't have a fix right now, but it is on my list of things to look at before I submit the next release.
    Edit: Fixed, I'll PM the file to you.
     
    Last edited: Oct 22, 2013
  50. Dharma_raj

    Dharma_raj

    Joined:
    Jun 21, 2013
    Posts:
    109
    Hey It appears now and working Thanks!!

    I got stuck in a new problem, I tried my best but couldnt find a solution. The power ups were not spawning at all. Please help. What are all the thing do I need to check to get it appear?