Raiders of the Lost Art Raiders of the Lost Art

Unity Tutorial – Infinite Runner

For this aspect of our key learnings, we explored how to create an infinite runner depicted in games such as Temple Run, Catabalt and Mario Run. The tutorial helped us gain the knowlege to produce and spawn objects in front of the subject during the real time dynamic of gameplay containing the player within a set of boundaries using 2D box colliders and a tracked camera positioned on the player, by utilizing the standard assets pack from the Unity store we were able to investigate the sprite sheets of the character as well as the scripts utilised by the developers. there has been a lot of controversy over steam greenlight and the Unity assets store as it allows for an easy and accessible package to developers with a beginners level of knowledge as they are repackaged and uploaded onto steam greenlight and earn the ripper money for a product that is not there’s, an assets pack should only be used to assist the developer in understanding code and the mechanics of play aiding the development process.

At the beginning of our development, we created a folder structure (Scripts, Sprites, prefabs, animation, sounds etc) that would allow us to organize our files and link scripts together that would not work otherwise. We created multiple sprites that would be used for our ground layers and made them tiled prefabs that would stretch dependant on the size and length of the sprite adding a box collider 2D to allow the user traction on the prefab instead of falling through and dying on the death sprite/script below. Placing the 2D character from the assets pack into our scene we explored it’s scripts and sprite animations, we then added the player controls to the character allowing him to move in our scene allowing him to jump and move by the arrow keys, hence we then added the camera to track the player so it would follow the player throughout the generated scene.

We created the death script and placed it on top of a 3d quad allowing the level to reset to the beginning if the player was to trigger the quad, we duplicated the object and placed it just behind the camera and allowed a 2dboxcollider to trigger and destroy the generated prefabs in the level to optimize the game; this trigger was set behind the player as to never allow the player to touch it as we let him autorun towards the right in the player_controls script. We placed the spawner in front of the character to allow objects to be generated in front of him created a challenging infinite runner/platformer that would challenge the user, we were able to adjust the spawner script to allow generated prefabs to spawn by the implementing an array creating randomised lengths of prefabs.

 

Tags: , ,

Share Post :

More Posts

Leave a Reply