Infinite Runner Starter Pack

@Dharma_raj - You can enable "Free Horizontal Movement" on the Input Controller and that will prevent it from using the slots. In terms of having a turn with the platform transition, you should be able to. Platform transitions are basically an extension to the appearance rules so it shouldn't interfere with whether or not it is a turn.

@abhishek1191 - There isn't anything within the code that you posted that is platform specific. The Input Controller is more platform specific though so depending on what StaticVar does it may not be executing.

Make sure the bottom collider of your scene is using the "Floor" layer. Also, you could start the raycast from a little bit above the height of the player to ensure the character's position isn't below the floor:

Hi,
How can we instantly jump or slide without the need for the animations to finish ?
Right now when i slide then slide again fast, nothing happen ! just the first slide animation is played but the collider become small again, i am using the mecanim version, i tried 0.1 exit time from slide and jump animations but the problem still the same, how to fix that please ?

For jump you can set the "Repeated Jump Delay" parameter on the Player Controller. If this is set to 0 then as soon as the character lands they will be able to jump again.

The slide animation is one continuous animation so you'll need to split it up into multiple states if you want to be able to reset the animation. For that I would have the states Enter Slide -> Slide -> Exit Slide, and then you can keep repeating the slide animation for as long as you want.

Hi @opsive I am working on turns and cross roads, the issue I ran into is that my own meshes of turns are not working like When I mark the turn right or left option in the inspector the the platform spawns but it just act as a straight platform.

So I used your turn platforms and parented them to my platforms, it solves this issue. But the player is now able to turn as soon as it enters the collider of the turn platform, I want it to be able to turn only when it reaches the point where it has to take the turn. Please help!

In that case you'll need to add a TurnTrigger to the crossroads and make sure restrictTurns and restrictTurnsToTurnTrigger is enabled. This will prevent the player from turning until they reach that trigger. The downside of this is that it will also force the player to turn when at a crossroads and has the invincibility/speed powerup. To prevent that you can add something like the following to the turn trigger:

In that case you'll need to add a TurnTrigger to the crossroads and make sure restrictTurns and restrictTurnsToTurnTrigger is enabled. This will prevent the player from turning until they reach that trigger. The downside of this is that it will also force the player to turn when at a crossroads and has the invincibility/speed powerup. To prevent that you can add something like the following to the turn trigger:

Hi @opsive We ran into a new problem now. While testing out the all the platforms, obstacles and scenes just disappeared. When I checked everything in the infinite objects got turned off on its own. I have attached
the screen shots of the hierarchy. Please help!

Hi @opsive We ran into a new problem now. While testing out the all the platforms, obstacles and scenes just disappeared. When I checked everything in the infinite objects got turned off on its own. I have attached
View attachment 121819
the screen shots of the hierarchy. Please help!

Click to expand...

Hmm I haven't seen that one before. I know that it may be hard to do, but is it possible for you to reproduce it with the included demo scene?

Hi Opsive,
How do I detect the player hits the obstacles in sideways? I want the player to die only when he collide into the obstacle from front. If he did it from side he should bounce back to the lane. Any ideas?
Thanks
Dharma

Within the obstacle's on trigger enter you can determine the dot product between the player's forward direction and the direction of the obstacle. If the dot product is close to 0 that means the collision was on the side. You would do something like the following with OnTriggerEnter:

HI Opsive,
Thanks for the idea. I've added your code in the obstacle trigger enter function and it is not working properly. Also based on the obstacle's rotation angles the debug log reacts in reverse. Do I need to make all the obstacles rotation values to zero. I did anything wrong?

Hi @opsive,
I am using cross roads as just straight path i.e I hvnt activated turns on the cross road. I just want moving obstacles like traffic to come from the sides so the player feels tht he hs to cross a busy cross road. I have attached moving obstacles with the cross road..now by attaching it works only once..like the traffic come from the side when the cross road spawns for the first time. But then those obstacles fall off the platform and the next time cross road spawn it is without the obstacles. How should I go ahead with problem, please help!

When the crossroads spawns again, are the moving obstacles still a child of the crossroads and just not activated? Are you running the most recent version? There was a bug similar to this awhile ago but it should be fixed with the latest version.

When the crossroads spawns again, are the moving obstacles still a child of the crossroads and just not activated? Are you running the most recent version? There was a bug similar to this awhile ago but it should be fixed with the latest version.

Click to expand...

yes, they are active and still the child of crossroad but not in the correct position. we are using the latest version too.
Actually i want to reset the position of moving obstacle when they are attached to a platform. Is there any way i can reset a particular obstacle through platformObject or may be just remove movingObstacle from infinite object and use it as platform child.

Does the same problem occur with the demo scene? I just tried it, and the cannonballs were correctly positioned after the platform has been respawned.

To help debug, you can insert a breakpoint within InfiniteObjects:Orient(PlatformObject, Vector3, Quaternion). When a collidable object is activated again Orient gets called and that will position the object back to the starting position. This should reset the position.

The infinite runner documentation assumes that you have some Unity experience so I first recommend that you go through the Unity Learn tutorials. In particular, the Roll a Ball and Survival Shooter are good if you you are just getting started. From there you can watch the Using your own Assets video and that will show you how you can add your own objects.

Hi Opsive, One quick question, how do I make the infinite objects to spawn before Startgame calls. My camera is facing the horizon at the start up. For the first run I can see all the infinite objects, but in the next run I see only the startup object. After I hit play game button the infinite objects spawn suddenly which looks odd.

In the demo version the camera faces the opposite direction so when you hit play after a reset you don't even notice that only the startup objects are spawned. Since your camera is facing the 'correct' direction from the start you can spawn the remaining objects within GameManager.RestartGame immediately after ReadyFromReset (line 318):

In the demo version the camera faces the opposite direction so when you hit play after a reset you don't even notice that only the startup objects are spawned. Since your camera is facing the 'correct' direction from the start you can spawn the remaining objects within GameManager.RestartGame immediately after ReadyFromReset (line 318):

i go throught those tutorial.........thanx to help me....but i can't add my own track .......how can i design and how to adjust and where i change to set my track in these project...........pls tell me.......i want to add my track in these project

hi im new to this UNITY world. i have downloaded the infinite runner starter pack ..... Pls send me the tutorial for operating the game ..... im new to UNITY

Click to expand...

Welcome to Unity Take a look at this post for some links to some starting videos. I highly recommend that you first go through some of the Unity Learn tutorials first as that will dramatically decrease the amount of time that it takes to get your own game up and running.

Hello Opsive, i am an artist trying to work on this Infinite Runner pack and have a query about coins appearance. I want the coins to appear in multiple lanes at the same time in the same position to get proper benefit from Coin Magnet Power Up, plz help me in this matter. I have not much understanding of coding.

Unity Technologies

@Uzair_Baig - please can you PM me your invoice for the Infinite Runner pack. I couldn't find your order in our database. It's possible your purchase was made using a different email address in which case your invoice will show that.

Hi Opsive,
This question is regarding the NGUI system where I could able to tap two buttons at a time which results in opening two different panels. Also it calls quit and resume functions together when hitting the corresponding buttons simultaneously. Any help?

Hi Opsive,
This question is regarding the NGUI system where I could able to tap two buttons at a time which results in opening two different panels. Also it calls quit and resume functions together when hitting the corresponding buttons simultaneously. Any help?

Thanks
Dharma

Click to expand...

I think that would be an issue with NGUI more so that this kit. Have you tried searching/posting on the NGUI forums to see if anyone else has had the issue or can help? This would be the same issue on any project that uses NGUI. Sounds like you need to disable multitouch functionality within NGUI.

Thanks, But I tried disabling multi touch already. The problem not occurs when tapping multiple buttons at a same time, but when hitting the buttons one after another within fraction of a second.

Click to expand...

Does NGUI have an input delay? So you cannot interact within x seconds/frames of the last interaction? Otherwise the Menu System will have to be updated to store which button was pressed and not allow another button to be pressed which overrides it. That would be an update for this pack.

If I buy the Pro version, how feasible would it be to extend the gameplay? I'm thinking of things like different power ups, flame jets shooting periodically from the sides or floor, etc.

Click to expand...

Thanks for taking a look at the infinite runner. Those modifications are minor so it is pretty easy to make those changes. What type of power ups are you thinking of adding? For the flame it would just be a particle system attached to the platform or scene object.

Thanks Justin. I was thinking of powerups that (for example) only work on certain types of obstacles; so you might be able to burst through wooden objects but still crash on metal or rock. But as long as there are hooks in the code for adding new powerups I can probably sort that out.

On the flame jets I was thinking of more than just visuals but actually having them kill the player if he passes the jet at the wrong time. So effectively a periodic obstacle.

Thanks Justin. I was thinking of powerups that (for example) only work on certain types of obstacles; so you might be able to burst through wooden objects but still crash on metal or rock. But as long as there are hooks in the code for adding new powerups I can probably sort that out.

On the flame jets I was thinking of more than just visuals but actually having them kill the player if he passes the jet at the wrong time. So effectively a periodic obstacle.

Click to expand...

Both of those are pretty easily possible.

The power ups are controlled through the PowerupManager component. There is an enum that lists all of the power up types. For your new power up you'll have to define an enum and then within the ObstacleObject component you'd check to see if that power up is active. If that power up is active and the obstacle is the wooden crate you would not hurt the player because they ran into it (and play the bursting through wood animation). If the obstacle is metal or a rock then you would injure the player like normal. The code would be very similar to the invincibility power up.

In terms of the flame, you would take a similar approach as the power up. If the flame is active then you injure the player, otherwise you let them pass without any damage.

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.