5 Minute ENDLESS RUNNER Game UNITY Tutorial

  Рет қаралды 103,639

BMo

BMo

Күн бұрын

In this Unity Tutorial, learn how to make an Endless Runner or Infinite Runner game in 5 minutes! Or... at least the foundation for one.
There are many different approaches when it comes to the Endless Runner genre. Sometimes the player is stuck on a track and can only move in one axis, sometimes the player can freely move wherever they want while the camera scrolls. It depends on how you want to design it!
For this example, the camera will be stationary, the backgrounds will scroll across the camera and reset, and the player will only be able to move vertically within the confines of the camera to avoid incoming obstacles.
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
➤LIKE the video if you enjoyed, it really helps the channel!
➤Join our DISCORD SERVER: / discord
We have channels to help you with your problems!
0:00 Repeating Background
The first thing we need to do is setup our repeatable scrolling background. I used an outer space theme as it's just an easy way to accomplish this, but there are plenty of resources out there on how to make your own "seamless pattern" images.
Here is the 1.5 minute Photoshop tutorial I followed to make my space background: • How to Photoshop Space...
My image was 2000x1000 pixels, which in Unity world space units is about 20 x, 10 y in our default Main Camera. This means that with my first image set to the origin position (0,0,0), a second image could be placed at (20,0,0) to be perfectly lined up.
Once you have a seamless pattern created and you've tested it by aligning 2 of them, we then want to add a BoxCollider2D, a Rigidbody2D, as well as a script to handle the scrolling & resetting position logic.
The BoxCollider2D will be used to store the width of the image, as adding a Collider2D defaults to auto-sizing the image (which is desireable in this case).
The Rigidbody2D will be used to move the background images across the screen.
The BackgroundScroller script will make all of that happen.
2:50 Player Controls
For my example, I'm restricting the player to only move up and down vertically. I used a 64x64 pixel square as the Player, set its sprite color to Cyan, added a Rigidbody2D component, as well as a new C# script PlayerController.
In PlayerController we get the Vertical Input axis value in our update, and setting our Rigidbody2D velocity we multiply the input axis by our movespeed.
Here are some other tutorials where I've covered player movement in more detail:
2D SideScroller Movement Tutorial: • 2D Side Scroller MOVEM...
2D Top Down Movement Tutorial: • 2D Top Down Movement U...
6 Minute Pong Tutorial: • Making PONG in 6 Minut...
3:45 Bounds Detection
After setting up our player movement, the player is able to move outside of the bounds of the Main Camera. This is obviously not desirable (or is it?... you be the judge!), so we need to confine our player to stay within the camera's view.
We could have the camera follow the player, but that breaks my design. Instead, I just added 2 new empty GameObjects, gave them BoxCollider2D objects, and using the tool in the Inspector, dragged the bounding box to be the length of the camera on the top and bottom edges.
4:02 Spawn Obstacles
Before we talk about spawning or instantiating any obstacles, we need to first make an obstacle to use! Reusing the same 64x64 pixel square as the Player, I scaled it up 5 in the x, and 5 in the y. I also colored it Red, and added a BoxCollider2D component with Is Trigger checked to True.
It's important to add a tag to these Obstacles, so I created a new Tag called... well, "Obstacles" and assigned it. I then made sure there was an Obstacle GameObject nested under each Background GameObject.
To spawn these Obstacles, at the start of the game as well as every time a background image resets its position, I fetch the Obstacle GameObject by using the background's transform's GetChild method. I then simply set the Obstacle localPosition (important when working with nested GameObjects) to a new Y position between -3 and 3. I determined these values by dragging the obstacle in the editor to the top and bottom edges of the camera and rounding to the cleanest number.
I wanted to give a short demonstration of how it could be done, but I think here is where you will need to expand things in your own project to really make it... interesting.
4:44 Obstacles destroy Player
The last thing we need to do is modify our PlayerController script to make it so if a Player collides with one of these Obstacles, then the game ends. Using the tag setup in the previous step, within our OnTriggerEnter2D event, we can check the other gameObject's tag if it's "Obstacle" and if it is, Destroy the player.
4:54 You did it!
Way to go Lil Noober! If you struggled to get to here and have questions, leave a comment or join our discord and post in our problem-solving channel!
#bmo #unity #tutorial

Пікірлер: 224
@terabyte9709
@terabyte9709 2 жыл бұрын
People do speedruns while playing games, this dude does a speedrun making games. A True LEGEND
@Billman07
@Billman07 2 жыл бұрын
Build different...
@notbotpot7559
@notbotpot7559 3 жыл бұрын
I love your tutorials so much I watch them when I'm not even trying to make a game
@BMoDev
@BMoDev 3 жыл бұрын
You're the best!
@notbotpot7559
@notbotpot7559 3 жыл бұрын
@@BMoDev no you are also thank you so much your discord is really helpful
@belalmansour1450
@belalmansour1450 3 жыл бұрын
Yh I'm trying to make a completely different game but I thought oh well I might as well watch it
@deadbroadcastpc
@deadbroadcastpc 3 жыл бұрын
Man these 5 minute videos are what’s up! Straight to the point and informative. Can’t wait to see more my friend.
@BMoDev
@BMoDev 3 жыл бұрын
Thank you, appreciate you 🙏
@LaurisG_
@LaurisG_ 2 жыл бұрын
God bless "Pause" button! :-D
@Wotan363
@Wotan363 3 жыл бұрын
I really love this tutorial, cause it covers the basics in a short amount of time, is also easy and good explained, espesially when u just take a look into the description :D thank u
@amandacollins7392
@amandacollins7392 3 жыл бұрын
Didn’t think this video could get more helpful until I clicked on the description box! You are the real tutorial MVP!!
@BMoDev
@BMoDev 3 жыл бұрын
:D
@IceCream-sb7lc
@IceCream-sb7lc 3 жыл бұрын
BMO! I never knew that you had such detailed descriptions....I too believe that you are the real MVP
@neenaw
@neenaw 3 жыл бұрын
This is a super concise and easy way of doing this. I've never actually tried this but I totally should. Great video!
@BMoDev
@BMoDev 3 жыл бұрын
Appreciate it! Yeah give it a shot, once you get the foundation in place you get to solely focus on content - quick to prototype compared to some other genres.
@Daniel_He09
@Daniel_He09 2 жыл бұрын
the repeat background part is just what i needed!
@peeei7423
@peeei7423 3 жыл бұрын
this is amazing!!!
@Hollowdude15
@Hollowdude15 Жыл бұрын
Great video man :]
@BloodBathFenix
@BloodBathFenix 3 жыл бұрын
Bro This was BRILLIANT
@NobodyAtAll420
@NobodyAtAll420 2 жыл бұрын
I got it to scroll vertically by changing this stuff. public new BoxCollider2D collider; private float height; private float scrollSpeed = 0f; height = collider.size.y; (scrollSpeed, -2); If (transform.position.y < -height) Vector2 resetPosition = new vector2(height * 0f, 40;
@JSCR1
@JSCR1 2 жыл бұрын
Doctor: Sir, you have 5 minutes to live. BMo: Open up Unity, and get this project started.
@omarmagdy1075
@omarmagdy1075 3 жыл бұрын
Great tutorial really helpful
@eileeng2492
@eileeng2492 3 жыл бұрын
Glad to be one of the first to catch it. I'm actually learning alot from these videos. Cool👍
@BMoDev
@BMoDev 3 жыл бұрын
Thanks!
@Irishpierre1
@Irishpierre1 3 жыл бұрын
Super fun 5 min tutorial! Really sets the groundwork for a really fun game!
@syedmoin7939
@syedmoin7939 3 жыл бұрын
kzbin.info/www/bejne/g2WolaRjaap1p9E
@LongButtocks
@LongButtocks 3 жыл бұрын
Hi, love the tutorial. I have a quick question, how would you go about adding more background images linking next to each other rather than just one stagnant image that loops? I want to have about 3 scenes of different backgrounds, it can be something like background 1, 2, 3 then loop.
@yooalinutza17
@yooalinutza17 2 жыл бұрын
Great video! It was really helpfull!
@slmusic1993
@slmusic1993 Жыл бұрын
Awesome tutorial bro, applied the same concept to 3d objects and came up with a similar result.
@noparkingnoparking
@noparkingnoparking Жыл бұрын
this worked thanks
@katerynaivinska658
@katerynaivinska658 3 жыл бұрын
Thanks for tutorial! I have question. After adding backgroundscroller script did you do something in inspector? Like adding value to collider and rb or it just none?
@carsonpaige9306
@carsonpaige9306 2 жыл бұрын
Thanks for this, it helped me out a lot
@BMoDev
@BMoDev 2 жыл бұрын
Awesome
@OkPandaYT
@OkPandaYT 2 жыл бұрын
this man is just built different
@kennedydike2970
@kennedydike2970 3 жыл бұрын
Great Tutorial!
@BMoDev
@BMoDev 3 жыл бұрын
Thanks!
@enciontioar
@enciontioar 3 жыл бұрын
hiya, thanks for the tutorial! although i think i did something wrong, the player just phases through the obstacle, is there a way to either show a game over screen or to make the player reset/disappear?
@galeelraglen
@galeelraglen 2 жыл бұрын
Thank you :)
@RandomGuy-df5us
@RandomGuy-df5us 3 жыл бұрын
Love your vids it's simple yet very informative
@BMoDev
@BMoDev 3 жыл бұрын
:)
@BaoTran-jo8lj
@BaoTran-jo8lj 2 жыл бұрын
hey can I ask you what theme color you're using in the VSC IDE ? thanks
@arpityadav4518
@arpityadav4518 3 жыл бұрын
my obstacle resets before it goes out of the screen , im using 3 backgrounds and i did width*3 too but still obstacle gets resets early please help
@megaminx96
@megaminx96 3 жыл бұрын
I don't know if someone has the same problem, I followed the tutorial and everything works. Then I added a new method to spawn obstacles in different pattern. The problem is that everything start to wobble / shake, even thought I setted a constant speed like in the video
@Rovsau
@Rovsau 2 жыл бұрын
Subbed!
@realworldvlog1
@realworldvlog1 Жыл бұрын
Thats good
@lycoebitner4287
@lycoebitner4287 3 жыл бұрын
thankss :D
@BennysRadio
@BennysRadio 3 жыл бұрын
I just did it! It took me 30 minutes though, I was a bit picky with my background a player character ^^ Great job, its great to let people do something in the engine that works!
@BMoDev
@BMoDev 3 жыл бұрын
Nice job! Feel free to share on the discord (only if you want to), I'd like to see how yours came out 👀
@dhruvdornal6381
@dhruvdornal6381 3 жыл бұрын
Bruh did you made the same game or changed the character and obstacles ? And from where did you get the objects
@BennysRadio
@BennysRadio 3 жыл бұрын
Dhruv Dornal 8D Songs you can get free sprites at sites like opengameart.org or kenney.nl to let your prototypes look nicer. I made basically the same game and to get back to the engine after some breaks and changed just some minor things. Never shared it though.
@dhruvdornal6381
@dhruvdornal6381 3 жыл бұрын
@@BennysRadio ok so we can add character and obstacles like subway surfer games for free ?? Right
@BennysRadio
@BennysRadio 3 жыл бұрын
Dhruv Dornal 8D Songs depends on the license the creator posted it to the sites. On opengameart you can see the licensing model on the left side. If somebody posted a subway surfer like set and give it away for free with for example the public domain license, than yes. But some licenses require things to do. Like mention them in the credits or linking to them. It’s all explained in the license mode they choosed.
@killinganime5104
@killinganime5104 2 жыл бұрын
@BMo what do you use to edit the script
@santiagojuarez1289
@santiagojuarez1289 3 жыл бұрын
You sound like brackets jaja, love your tuts. Keep the great work bro 💪
@BMoDev
@BMoDev 3 жыл бұрын
Really?? But I'm not Danish 😁 Thats certainly a compliment to me - appreciate it!
@definarte
@definarte Жыл бұрын
if your background does not fit into the camera, reduce the camera size to 4 and it should work 👍 thanks for the video!
@billkasperdotcom
@billkasperdotcom 3 жыл бұрын
I'm working on a game called "I have ADD". I'm learning Unity 5 minutes at a time, max. Thanks!
@jason.arcuri
@jason.arcuri 2 жыл бұрын
I’m learning the same way lmao; 5-10min Unity videos are now built into my daily school routine
@mikekonstadinidis4498
@mikekonstadinidis4498 3 жыл бұрын
the script of backgrounds didnt work , i follow same steps and make everything the same way ,an (expected) error dont let me play the demo of the game some help pls
@egeozz
@egeozz 3 жыл бұрын
Yes Same
@Shantal585
@Shantal585 3 жыл бұрын
when i do the repeating background it functions properly but when it resets like the border tears and you can see the background
@syedmoin7939
@syedmoin7939 3 жыл бұрын
kzbin.info/www/bejne/g2WolaRjaap1p9E
@purjolokgaming8482
@purjolokgaming8482 2 жыл бұрын
Hey @BMo i think i have followed every step correctly but when I press play my obstacles always dissapears behind the background and I don’t know what to do???
@BMoDev
@BMoDev 2 жыл бұрын
You probably have the obstacles on the same sorting layer. Check in the Sprite Renderer in the inspector
@purjolokgaming8482
@purjolokgaming8482 2 жыл бұрын
@@BMoDev thank you, i looken around a bit and finally i got it. Now everything works fine👍👍
@whitesheep1417
@whitesheep1417 2 жыл бұрын
I tried the background code but i got the error: Embedded statement cannot be a declaration or labeled statement. Does someone have any idea how i can fix this because i have no clue i just started programming.
@1Fated
@1Fated 3 жыл бұрын
What if wanted to move my player in the vertical axis. What do i need to change in the script to make it work??
@NobodyAtAll420
@NobodyAtAll420 2 жыл бұрын
Either change the get axis to Horizontal or add another line of code the same as how you have it moving vertically but use the word Horizontal if there is an x change it to a y.
@Kuiekuie
@Kuiekuie 3 жыл бұрын
How do I make it so the Obstacle also spawns on the middle?
@xsool-yl7us
@xsool-yl7us Жыл бұрын
how did you code the scroller itself? like what app do you use?
@DoB7709
@DoB7709 Жыл бұрын
From the logo on the top left of the coding screen i think he uses microsoft visual studio
@mekky8230
@mekky8230 3 жыл бұрын
How the hell do you make VisualStudio show the references above the variables? Been searching my ass off but can't find anything of use on the subject. Also... why aren't my variables turning green like yours? They just stay white... I'm working in the latest version of VisualStudio...
@nchtblut
@nchtblut 3 жыл бұрын
SAME F
@Azazel.x
@Azazel.x 3 жыл бұрын
You have to download extensions for that to work. Also He is just using another theme. The colours and such varies accordingly
@omerreyli195
@omerreyli195 3 жыл бұрын
Help pls, if i go to unity there is a "the name scrollspeed does not exist in the current context" at the bottom left. Someone explain pls. Thanks
@BMoDev
@BMoDev 3 жыл бұрын
You have a typo most likely. Can you share your script?
@oak4417
@oak4417 Жыл бұрын
For anyone who has a problem with it not scrolling right and they are using a sprite, try setting width to the length of your object
@lucasjacobs1739
@lucasjacobs1739 3 жыл бұрын
I got on the end an error of the word "other" how can I fix this?
@Amvnedits
@Amvnedits 3 жыл бұрын
I keep on getting error about background scroller I followed ur step by step but I keep on getting them
@sankalpbhagat9904
@sankalpbhagat9904 Жыл бұрын
one word for u GOD
@beccabigcca
@beccabigcca 3 жыл бұрын
HI i follow step by step but when i played my background it is still in static form what should i do?
@beccabigcca
@beccabigcca 3 жыл бұрын
its ok now but the image scroll incontinuously
@FC12CGaming
@FC12CGaming 2 жыл бұрын
The Movement and the wall is working but the sprites go underneath the background
@ItsMeHelel
@ItsMeHelel 3 жыл бұрын
What is your VSCode theme?
@jantheanimator
@jantheanimator 2 жыл бұрын
I need help. The BackgroundScroller script doesnt show up in the place where you select a component.
@NobodyAtAll420
@NobodyAtAll420 2 жыл бұрын
Drag and drop it onto the object and it should add it to the object automatically.
@NobodyAtAll420
@NobodyAtAll420 2 жыл бұрын
Also you have to hit ctrl+S to save it in your code editor then go back to unity and unity should reload then it should be available if you copied it exactly and remember to save before switching back to unity.
@peoofhunter5954
@peoofhunter5954 3 жыл бұрын
Im use your game and share itch io ?
@cheecha3
@cheecha3 3 жыл бұрын
Thank you ! I learned much from this tutorial. The only problem is i can't manage when i run into obstacle my rocket just pass it.
@BMoDev
@BMoDev 3 жыл бұрын
Setting "IsTrigger" to true lets you pass through objects instead of collide, however if you are setting up the OnTriggerEnter2D method in your PlayerController to Destroy your player GameObject, it will have the same effect. If you don't want the obstacles to kill your player, but rather just collide with them, you may have to change the approach a bit.
@cheecha3
@cheecha3 3 жыл бұрын
@@BMoDev Thanks, i have managed it. Now i'm struggling to add shooting to the player so i can also destroy obstacles. Have you got any clue what script to use? Thanks!
@highscore4866
@highscore4866 3 жыл бұрын
Nice vid man i subbed But tbh thats a very sly and crapy substitute for an obstacle spawner
@MirehManuh
@MirehManuh 3 жыл бұрын
question as to why my obstacles are sticking to the right side am i doing something wrong
@pimonsolak3692
@pimonsolak3692 3 жыл бұрын
Try to check the code with ResetObstacle and check thu numbers you have written there.
@SliCooper
@SliCooper 2 жыл бұрын
Ok so I follow the script word by word but when I start it the 2nd image resets exactly where my first image is. How do I fix that?
@kingcreatez4827
@kingcreatez4827 2 жыл бұрын
that happens to me aswell, have you managed to fix it?
@N473
@N473 Жыл бұрын
@@kingcreatez4827 Ended up fixing mine a while ago by just copying another background over and shuffling them around.
@SmashEmDEV
@SmashEmDEV 3 жыл бұрын
Please help i am stuck it says: warning CS0108: 'backgroundscroller.collider' hides inherited member 'Component.collider'. Use the new keyword if hiding was intended. Please need help as soon as possible thanks.
@samlion7308
@samlion7308 3 жыл бұрын
Change the name of your BoxCollider2D from "collider" to "bxcollider"
@JSCR1
@JSCR1 2 жыл бұрын
@@samlion7308 What do I edit? Do I make BoxCollider2D into Boxbxcollider2D?
@samlion7308
@samlion7308 2 жыл бұрын
@@JSCR1 they create a box collider 2d named collider, that's not a good name because "collider" is a reserved word
@qqq9542
@qqq9542 3 жыл бұрын
This is awesome!!! But what if i want to increase the difficulty of the game as time goes on? How do i generate more obstacles the longer the player stays alive? Thanks! :)
@NobodyAtAll420
@NobodyAtAll420 2 жыл бұрын
You need an object pooling script to randomly call different objects.. At least that's what I've figured out so far. Hopefully this info helps lead you to find more info.
@ammar_arain
@ammar_arain 3 жыл бұрын
Hello I'm trying to make a 2D endless runner game for a school project and I've did everything you did but my background scroller doesn't work and the player does not get destroyed when it touches an obstacle. I also need to make it for a phone so I'd also need a reset button, if anyone knows of any tutorials that can help me out please let me know.
@kingcreatez4827
@kingcreatez4827 2 жыл бұрын
same with me, my background resets its position on top of eachother, did you manage to fix yours? if so please tell me how
@ammar_arain
@ammar_arain 2 жыл бұрын
@@kingcreatez4827 Hope you find the solution though, best of luck!
@Massive-3D
@Massive-3D 3 жыл бұрын
DAYUM!
@pawanprince2088
@pawanprince2088 3 жыл бұрын
Bro are you a game developer Could u say. Your qualification As i need that for my future
@sipronikun
@sipronikun 3 жыл бұрын
semih jsuis first avec ce projet
@maketolaughyou6402
@maketolaughyou6402 3 жыл бұрын
Can i get these scripts please ? Please tell where to find
@Josh51507
@Josh51507 3 жыл бұрын
Amoung is background?
@thecanaeggplant2937
@thecanaeggplant2937 3 жыл бұрын
More videossss
@dhruvdornal6381
@dhruvdornal6381 3 жыл бұрын
Btw I wanted to ask from where can I get a character like a human for my game ?? Can someone help me out
@fukaze2021
@fukaze2021 2 жыл бұрын
there's a lot of freebies in itch.io
@ChupaChups2626
@ChupaChups2626 3 жыл бұрын
how do i make the player game over when touching the obstacle ?
@ChupaChups2626
@ChupaChups2626 3 жыл бұрын
in the video, after the player hit the obstacle, the player is destroyed. but the game is not over. how to fix this ?
@pimonsolak3692
@pimonsolak3692 3 жыл бұрын
@@ChupaChups2626 im asking the same question. The only thing i managed to do is when the player hits the obsatcle the game stops and nothing happens next. But still dont know how to make the game repeat.
@Reddit-stories404
@Reddit-stories404 2 жыл бұрын
@Yuvaraja M I would recommend making a new scene and writing that when he collides it changes scene to a scene that says game over
@krisztianpapp884
@krisztianpapp884 3 жыл бұрын
What the program code? 🥺
@gamer310taka9
@gamer310taka9 Жыл бұрын
it so good i won my school best game
@johnryanaparece8215
@johnryanaparece8215 3 жыл бұрын
I Love your tutorials but how do u make it into a mobile game?
@RAIM_AHMED_TV
@RAIM_AHMED_TV 3 жыл бұрын
hey my player passes from enemy without getting out please help!!!!🤔
@ammar_arain
@ammar_arain 3 жыл бұрын
I have the same problem...that and my background glitches
@jantheanimator
@jantheanimator 2 жыл бұрын
Im gonna make a video about it.
@mistertibbels1222
@mistertibbels1222 Жыл бұрын
Which Version???
@osamaabuzayed2198
@osamaabuzayed2198 3 жыл бұрын
Idk why you have 2k subs you should have 2m
@BMoDev
@BMoDev 3 жыл бұрын
Appreciate that 🙏
@DonHart
@DonHart 3 жыл бұрын
How to move it on Andriod?
@harkl3ss974
@harkl3ss974 3 жыл бұрын
I keep getting CS0245 with 'Rigidbody2d' I have no idea what to do, 'New to coding' using System.Collections; using System.Collections.Generic; using UnityEngine; public class backgroundScroller : MonoBehaviour { public BoxCollider2D collider; public Rigidbody2D rb; private float width; private float scrollSpeed = -2f; // Start is called before the first frame update void Start() { collider = GetComponent(); rb = GetComponent(); width = collider.size.x; collider.enabled = false; rb.velocity = new Vector2(scrollSpeed, 0); } // Update is called once per frame void Update() { if (transform.position.x < -width) { Vector2 resetPosition = new Vector2(width * 2f, 0); transform.position = (Vector2)transform.position + resetPosition; } } }
@thesauce5517
@thesauce5517 2 жыл бұрын
if you haven't figured it out yet on "rb = GetComponent();" you need to capitalize "2D" Code should be rb = GetComponent();
@kcpr_l9205
@kcpr_l9205 2 жыл бұрын
Wtf none of my code doesn’t work it’s exactly the same I write it, I go back to unity and press play and it doesn’t do anything please help me I beg
@13daffaafaalihbimap.d9
@13daffaafaalihbimap.d9 2 жыл бұрын
why in my unity the hero doesn't destroy if hit the obstacle?
@13daffaafaalihbimap.d9
@13daffaafaalihbimap.d9 2 жыл бұрын
please help me
@Haffey.z64
@Haffey.z64 2 жыл бұрын
does this work for mobile?
@Mx.Seryyy
@Mx.Seryyy 7 ай бұрын
is the assets free
@RikalicTR
@RikalicTR 3 жыл бұрын
My player dont die what can i do
@comikawn5147
@comikawn5147 3 жыл бұрын
Hey Can you make serie to make Game look like HOTLINE MIAMI
@LemonTheWise347
@LemonTheWise347 2 жыл бұрын
I was looking for a tutorial for an autoscrolling game and found one, but the man was speaking really slow, So I took advantage of the ability to change playback speed and turned it to 1.5. I didn't like the length of the video, so I found this one. My first thought was "Wow, this man is really going at it." I'm an idiot.
@NubbyGamerYT
@NubbyGamerYT 2 жыл бұрын
How to Fix this 'are you missing a using directive'
@kjpalakshmirajthetalenteds5462
@kjpalakshmirajthetalenteds5462 3 жыл бұрын
sir is this a mobile game or a pc game???
@RaidenHeaven
@RaidenHeaven 3 жыл бұрын
Why not just offset the texture?
@vadim4ikbuilds663
@vadim4ikbuilds663 3 жыл бұрын
It doesn't work:(( please help me
@revinpasya4085
@revinpasya4085 2 жыл бұрын
scripct correct but cant move the player
@Wolfnoir60
@Wolfnoir60 2 жыл бұрын
Mines says other does not exist in current context can someone help?
@BMoDev
@BMoDev 2 жыл бұрын
Sure can you share your script?
@Wolfnoir60
@Wolfnoir60 2 жыл бұрын
@@BMoDev never mind I’m just very blind and need to wear my glasses thank you
@pimonsolak3692
@pimonsolak3692 3 жыл бұрын
Great tutorial! But i would like to ask that how do i make th game repeat after dying?
@pacothehunter8063
@pacothehunter8063 3 жыл бұрын
my obstacles stay still while the only thing thats moving is the backround
@BMoDev
@BMoDev 3 жыл бұрын
Are the obstacles child objects of the background?
@pacothehunter8063
@pacothehunter8063 3 жыл бұрын
@@BMoDev I wrote the code exactly as you did but I'm new to this so I don't really know
@pacothehunter8063
@pacothehunter8063 3 жыл бұрын
​@@BMoDev it appears that transform child is out of bounds....(thats what the errors are showing) how do i fix that?
@A1Blueru
@A1Blueru 3 жыл бұрын
how would you make the if transform position if you were to make this game a vertical scroller instead of horizontal?
@NobodyAtAll420
@NobodyAtAll420 2 жыл бұрын
Change width to height. Change width = to height = collider.size.y change all the x's to a y. Change transform.position.x to a y change
@Hobby555_
@Hobby555_ 2 жыл бұрын
i need the scroll script
@YukioLucas
@YukioLucas 3 жыл бұрын
what means f, in "-2f"?
@jellyhotdog4955
@jellyhotdog4955 Жыл бұрын
might be a bit late to reply but it means float
@09SkyFrost
@09SkyFrost 3 жыл бұрын
this is really a beginner friendly tutorial, thanks! its straight forward that I cant follow along, like wtf is wrong with my script its different than yours I have something going on like // start is called before the first frame update can u help me like wtf this is so hard to make and u only did it in 5 fukin minutes and I wanna die I followed your codes but it didnt worked help me, heelp, me
@fndusty4542
@fndusty4542 3 жыл бұрын
you can delete the stuff like //start is called... and such, they don't do anything due to the double forward slash infront of the text. I am assuming that is what this guy in the tutorial did. You might need to go and find another tutorial on youtube on how to make the character move, as this guy only shows what to put into the script and not how to make the input (up arrow on keyboard to go up, vice versa for down arrow, etc.) hopefully that helps you.
@09SkyFrost
@09SkyFrost 3 жыл бұрын
@@fndusty4542 Thanks dude, But im kinda confuse in these visual studio codes like first of all the // then he has something at the top of his code called reference? idk its so different than mine, im stressed out yesterday its like 1:00AM when I wrote that comment and he's like doing a speedrun instead of a tutorial
@fndusty4542
@fndusty4542 3 жыл бұрын
@@09SkyFrost I can agree- this tutorial does feel like a speed run with some cuts. If your visual studio code looks different, don’t worry. The reference thing wasn’t at the top of mine and it had worked, just type in the codes he types in the brackets. Yours should still have “void start” and “void update” as a default, and just go from there with the video. When it gets to the player controller though, I recommend watching one of the videos he has linked in the description for that section. They should help with inputs and movement, as you are a beginner you may not have that set up.
@09SkyFrost
@09SkyFrost 3 жыл бұрын
@@fndusty4542 Alright, Thanks!!! appreciate it 😁
@ammar_arain
@ammar_arain 3 жыл бұрын
@@fndusty4542 I can't find any tutorials and I really need to do it for a school project, do you know any good tutorials that tells you how to make a good endless runner for android 2D??
@adomasjarmalavicius2808
@adomasjarmalavicius2808 3 жыл бұрын
is anybody else posting comments in case he makes a 10000 player battle royal ?
@BMoDev
@BMoDev 3 жыл бұрын
lmaooo I just might one day
@januuuu2900
@januuuu2900 3 жыл бұрын
0:37 how can i sellect 2
@BMoDev
@BMoDev 3 жыл бұрын
Ctrl + Click
@januuuu2900
@januuuu2900 3 жыл бұрын
@@BMoDev k
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 3,8 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 40 МЛН
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 929 М.
2D Infinite Runner Unity Tutorial
24:25
MoreBBlakeyyy
Рет қаралды 20 М.
Procedural Generation: Endless Runner Unity Tutorial (Updated 2023)
9:28
Rigor Mortis Tortoise
Рет қаралды 16 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 487 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 676 М.
How much Money does my Free Mobile Game Make?
8:26
Sam Hogan
Рет қаралды 11 МЛН
Why Making Multiplayer Games SUCKS
6:46
Tom Weiland
Рет қаралды 389 М.
Flexible LOOT SYSTEM in Unity with Random Drop Rates
13:24
I Made a Game Using ChatGPT
9:51
Rye
Рет қаралды 2,5 МЛН
I Paid Game Developers on Fiverr to Make the Same Game
9:49
BadGameDev
Рет қаралды 3,4 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН