HOW TO MAKE A SIMPLE GAME IN UNITY - ENDLESS RUNNER - #4[END]
Ойындар
In the fourth and final episode of the how to make an endless in Unity and C# we will add UI and sound effects to our game as well as put into place a score system !
--------------------------------------------------------------------------------------------------------
SUPPORT ME : / blackthornprod
--------------------------------------------------------------------------------------------------------
PLAY the COMPLETE GAME : blackthornprod-games.itch.io/...
DOWNLOAD the COMPLETE PROJECT : github.com/BlackthornProd/End...
--------------------------------------------------------------------------------------------------------
FOLLOW ME on TWITTER : / noacalice
JOIN the BTP DISCORD SERVER : / discord
Пікірлер: 227
Hey everyone and well done for completing the series :) !! There's one little quirk with this video** , when you die the score still keeps on going up ! To fix this grab a reference to the player (public Player player) in the ScoreManager script and before increasing score of 1 make an if statement checking whether the player's health is greater than 0 ! That will fix the problem ! Cheers !
@AbhishekSharma-im6zo
5 жыл бұрын
Great Tutorial Looking forward to next tutorial hopefully Boss fight,
@luciacover9909
5 жыл бұрын
Thanks for this fix! Had this bug while following along!!
@MaxPicAxe
5 жыл бұрын
Also don't you need to add a Destroy script to the audio objects aswell?
@farukerturk3401
5 жыл бұрын
Blackthornprod Spooky Ghost on Google Play
@farukerturk3401
5 жыл бұрын
Spooky Ghost GooglePlay
Updating UI every frame isn't the best for performance reasons. It's much more efficient to abstract to a method and call that method only when the health/score actually changes. Probably won't matter for a game this small, but it's worth mentioning for individuals who like to write code that will scale. Great tutorial series! Really enjoy your approach to these tutorials.
@Blackthornprod
5 жыл бұрын
Thanks Michael for the support :) ! True enough it's best to update the UI in a function, should of mentioned that in the video* ! Thanks for pointing that out !
Hey Noa, just discovered your videos the other week after deciding to get back into game creation. I've failed and given up 4 times in the past but thanks to you and your incredible guides I'm very close to finishing my first game! Just wanted to thank you and wish you luck on your game's launch- wish I could afford to buy it but I'm holding out hope that it'll be in the winter sale. Hope to see more guides from you in the future and much love!
I love the videos that you make! Also your graphics style is really interesting and awesome! 😍
@Blackthornprod
5 жыл бұрын
Thanks again for the support :) ! I'm so glad you like my content !
@mirela9974
5 жыл бұрын
Blackthornprod 😊
Really enjoyed those 4 short videos, you were clear and straight to the point. Diffently helped with my own game. +sub
I'm loving your channel. It has basicly EVERYTHING I need to make my 2D game! Can't wait for the next episode! :D
This Tutorial was amazing and easy to follow, thanks Blackthronprod!
Your videos are very useful, when i asked google about something, your videos are always in top of answers. Keep it going!
Thank you very much! By following this tutorial I was able to refresh my knowledge of Unity and get back into making games.
man your scripts are so short and simplified , i love it. Most youtubers do super long scripts just for it to to the same function as yours
Video is 3 years old but still stand taller than so many. Love your way of explaining & Thanks for being so beginners friendly. Love you videos.
Very lovely tutorials, thanks for taking the time and effort to create such a high quality series^^ I'll swing by your Discord sometime today as soon as I polished some spare things and show you how it turned out :D
Thanks a lot for this serie. Thanks to you I did my first complete game with coding + scripting + little animation + sound/music. Was very nice.
I have to say, I recently watched every single one of your videos, but this one is by far the best video, and it’s part of the best series on your channel. Keep up the good work Noa! Also congratulations on getting 8,000 more subs in a month!!
@Blackthornprod
5 жыл бұрын
HAHA thanks so much Ben :) ! You've become one of my top supporters and your comments are so encouraging ! I'm really glad you enjoyed this series !
THANK YOU SO MUCH this was my seccond every game in unity and the first 2d one i learned a lot
Great series my friend. Still have so many questions how to do that, and that, but probably will come with time.
This tutorial is so helpful. Thanks!
"... shout something similar to a explosion" Me, a weeb: EKUSUPUROOOSON !!!!
@Lobobobo123
3 жыл бұрын
yes.
@Farhaan-td3dk
3 жыл бұрын
Boooommm...!!
Thank you so much for your tutorials!!
You are a legend fam. You are literally better than a college professor I have
Great tips! Thanks for sharing!
Good work man! I think I might found some answers to questions in my game :)
That is very clean serius thnks so much,I GET COOL LOOKING ON GAME DEVELOPING 🌹
I love your content and your games ❤❤ Keep up the great work!!!
@Blackthornprod
5 жыл бұрын
Thanks :) !! I'm definitely keeping it up !
Love your videos , you art style is really cool :D
Thanks for the cool tutorial!)
Thx dude wonderful tutorial
This is so helpful, thanks :)
As soon as I noticed your message on discord I had to watch this right away.
@Blackthornprod
5 жыл бұрын
Thanks so much for the support :) !
Great tutorial, thanks
I love this series!! its so amazing! and i think you would earn a lot of money if u put some of your sprites for sale
Thanks for the video. Of course a lot of things to improve, but I know you know it :-) I would add these lines to Update() function at Player class: public GameObject obstacleEffect; // Set EnemyDestroyFX gameobject here private GameObject[] obstacles; ... private void Update() { if (health
@DerDave0
5 жыл бұрын
Looks good and works as promised!
@ningtzy5034
5 жыл бұрын
how to set enemy destroy effects?
@vladventura1928
3 жыл бұрын
Oh that's nice, good stuff
Alternative way to add sound: go to your particle effects and and add the component Audio Source and then put the sound you want to play on it
Hi, i really enjoyed this series. I'd love to see similar guide in the future, where you would show us how to make a simple roguelike game. You mentioned this at the beginning of this series, so i'm just curious if i can expect it anytime soon.
@Blackthornprod
5 жыл бұрын
Thanks :)) ! I'm really glad you enjoyed the series ! A roguelike series is definitely in my plans :), though I can't tell yet when that will be, perhaps in a month ;) ?
@evilkiwi7446
5 жыл бұрын
Great, i'm looking forward to it! :)
Thanks for this tutorial
Saw this series i think 4th time. Waiting for the next series and who dared to dislike the video 😡😠
Hi! I,m glad, you add destroy script for obstacle and spawner)
thnx a lot brother ! :)
Thank you.
Good job!
Your tutorial is really amazing, thank you very much! You do go a little fast, I watched it on 0.5 speed sometimes so I could follow you, but I don't mind that. I do have a question about adding levels to this game. Would that be possible? I was thinking of having different backgrounds and obstacles for each level, I don't know if you could make each level randomly generate in a different pattern or something.
Very fun channel to watch. I watch your videos to see how other creators deal with common Unity tasks and to get some inspiration. I have a huge background in programming, so I have a bit different perspective on scripting. I'd suggest spending some time on learning how to manage class dependencies better. For example your Player class is responsible for too many things: handling input, updating UI. While it's not a problem in such small projects, as your game grows in complexity, you end up with difficult to debug and to fix bugs. Ideally you should be able to, for example, easily disable or swap the entire UI without modifying the Player code. This way you could promote more healthy class design. Cheers.
@ykingshyper6536
5 жыл бұрын
Hello #mrqbboy,,,i,m also a programmer , plz can you share some sources to learn from , about managing class dependencies and stuff!!?
@mrqbboy
5 жыл бұрын
I recommend the book Clean Code by Robert Cecil Martin.
My phone lagged when you said "Lagging".. Thought it was a clever edit until I replayed the video...
Thank you
Thanks for making this video 💓
@Blackthornprod
5 жыл бұрын
And thanks to you for supporting me :) ! It's really appreciated !
@noumanahmad3957
5 жыл бұрын
no problem you deserve more 👍
Thank you noa! your tutorial was amazing, as a c# and Unity beginner your explanation was clear. I learned a lot about Unity from this series :D As a gamemnaker studio user I am also interested in making tutorials, I thought this game is a really good project for beginners. Would you give me a permission to make a gamemnaker studio version of this tutorial? Sorry for my bad English.
wow 18k subscription.... reward for your hard work bro...... all d best
@Blackthornprod
5 жыл бұрын
Thanks mate :) ! Yep I'm really glad I've reach 18K, basically 1K for each year of my life :)) !
Hello! Nice tutorial! There is no need to create prefabs of music. Need play music with collider other objects. Sorry for my English.
Thanks tutorial
Love you bro for providing code.
I have a question, how do you make one of these for your phone That goes up instead of forward? And how do you make a sort of "jumping" animation? (I really like happy hop, and i wanna try making something like it)
Nice work as usual. :) bro can u please make a short video on 2d player slope movement. I have tried a lot of different things but nothing works perfectly .Thanks in advance
Nice tutorial. I think it looks a bit weird that the explosion particles don't move toward the left though.
hey man, i followed this guide using some other assets, but i got a question about the destroyer script. i copied what u wrote so i dont see why it shouldnt work XD but it actually stops spawning in obstacles :P
@SmailyPrado
3 жыл бұрын
It happens the same in my code. Still don't know why.
if anyone thinking to make same type of game and just want to add points by collecting coins orr anything then you can make that scoremanager as a child of your player and make it's collider however you like by the way this video is awesome i just got that idea when i was learning this so im leaving here an idea lol.......sorry :)
Keep it up this series was awesome make more I’ve said it before and I’ll say it again you need more subscribers
@Blackthornprod
5 жыл бұрын
Thanks for the support Ciaran :) ! I'm so glad you liked the series !
Great video
@Blackthornprod
5 жыл бұрын
Thanks :) !
Title: An endless runner! Also the title: [END] omg wow XD lolol XD end go brr help me
cool
Hello, great tutorial as always. I am creating a game on my own. I have completed everything, but I have difficulty putting the game on the appstore. it is not very clear unlike the playstore. if you want and if u have time, a tutorial about it would be great. Thanks for the attention!
@Blackthornprod
5 жыл бұрын
Hey :) !! I'm glad you liked the video and equally happy you're making a game ! I've never put a game myself on the app store so I really can't help you just yet, but if I do end up putting a game on that platform I'll be sure to make a tutorial on it !
@startfire98
5 жыл бұрын
Blackthornprod thanks! 😄
God bless you
You can put the score detector on the player and disable the mesh renderer...right?
i love you
Nice bro . I'm start learning unity by you.i done all the work you said but after bulid UI is not displaying in my gameplay.it is perfect in unity editor.i need a help bro .
Hey men, please teach us how make a cool 2D sword smash effect and how apply it on unity please! :)
Hi Great Tutorial, But is there a way to add touch function tu Up and Down the player on a Mobile device? Thanks !
i am waiting for your new series
Hello. I made the game exactly like how you did but I would like to add on a few other components like menu, log in log out, and shop but I am having trouble as I have created the menu but the game is running simultaneously with the menu. I have no idea on how to code the game to only run when the button is click instead of running it simultaneously
When the player dies you can stop the time with : Time.timescale = 0 and when you restart add this same line but with 1 : Time.timescale = 1.
Good tutorial but I want to ask about this error "NullReferenceException: Object reference not set to an instance of an object" due to this code line healthDisplay.text = health.ToString(); how to remove this?
please tell me how to set up w and s for android buttons (what a script should look like to add a function to buttons)
Thanks for the great tutorial! I do however have one little concern... If the player hits an obstacle, the obstacle is destroyed and the collider on the score manager only registrers one collision, which gives the player only one point on the score, instead of two. How do I fix this?
@xenos8929
5 жыл бұрын
I thik thats meant to happen as each obstacle is worth 1 point which is why the player is only given 1 point
Can we go over npc dropping items such as powerup?
For some reason, I don't see Health Display in the inspector for the Player but see it for the Score Manager I used the same code. any help?
Hey man, could you possibly do a video or series on tactics movement and player movement meshes. Perhaps check out a game called gladius from Lucas arts for an example
@Blackthornprod
5 жыл бұрын
I'll definitely take a look at that :) ! Stay tuned :) !
@kevinguiboche2359
5 жыл бұрын
Cool that'd be awesome, it's something that has really hindered a lot of my plans
if I have a game over scene and I want to display my score on the game over scene what should I do?? please help I am stuck
A little stuck here. Pressing R doesn't seem to work. all script is ok and exactly the same. it just doesn't want to recognise the key press. any ideas?
Can you plz do a video on how to make swipe controls for this game.
@cianbrady1557
4 жыл бұрын
Yes please
@fongaming101
4 жыл бұрын
Should be under edit, settings, input
I am new in game development, facing issue: Touch on screen not working why? I have followed the tutorial but why i don't know when I run the app in phone on touching screen nothing happening. Please help
yeah finally made can i make more levels and uplaod on playstore?
Hello I watched all the 4 parts of this tutorial and wanted to make it and publish, so can I use your game design to publish my game to play store , and are there any copyright ??. Pls reply
@ivanzujovic6679
5 жыл бұрын
u got to design your assets or use free assets u cant just straight copy his idea :p
how do u add a swipe up and down feature for the mobile phones
hi sir, nice and friendly tutorial, but how do i import into android/ios game? it says my 2018 unity doesnt have SDK eventhough i alrd downloaded it
There is no audio in the completed project on github :(
Episode 5 would be to polish, but I can do that on my own. Fixing the screen shake, stopping the score from counting a wave when I hit an obstacle and stopping the score counter from going after Game Over is what I got left to do.
@Andrewspieces
5 жыл бұрын
Hi. How do you get the score to stop going up after Game Over? I tried coding what Noa explained in the pinned comment, but having trouble. Thanks.
@kuntahouen3835
5 жыл бұрын
I don't know but I'm trying to figure it out myself. I'll come back when I've fixed it.
@Andrewspieces
5 жыл бұрын
Thank you. Trying to get an answer on the BlackThornProd Discord server, also.
@kuntahouen3835
5 жыл бұрын
Fixed it. It's exactly what the pinned comment says. So in the Score Manager script create a new reference to the player "public Player player;" Then in Unity drop your player into the player slot on the Score manager script in inspector so that the Score Manager script can access the player health from the player script. Your SM script should look like this. if (other.CompareTag("Obstacle")) { score++; Debug.Log(score); } Then in the SM script within the curly brackets above the score++, Write a new if statement "if (player.health > 0){}" then place the score++ and the Debug.Log into the new if statement's curly brackets. It should look like this in your SM script. if (other.CompareTag("Obstacle")) { if (player.health > 0) { score++; Debug.Log(score); } } I couldn't have explained that better so I hope it helped.
@Andrewspieces
5 жыл бұрын
That's excellent man. Thanks so much. I will add this to the code tonight. It looks like it should work. Good luck with your games and see you around :)
Can I use some of the assets in commercial games?
if I have a game over scene and I want to display my score on the game over scene what should I do ?? not please help I am stuck on this for the last 5 days
@andrevzs_
3 жыл бұрын
you can use a text that displays the variable Score
@ianbrucemazadeguzman6439
3 жыл бұрын
hi did you got it? can you messageme what did you do huhuhu
@ianbrucemazadeguzman6439
3 жыл бұрын
@@andrevzs_ how!!???
Plz make more series please!!!!
@Blackthornprod
5 жыл бұрын
I definitely will :) !! Stay tuned !
HI @Blackthornprod sir i would like to thankyou for GREAT Tutorial i love this simple Tutorial but nice Game Btw i would like to ask only sir cause i have a little bit issue Im trying to add Button Up or Down and Button for Pressing Restart game but i cant add it im newbie on Unity and c# so im getting lost can you Help me With this even just a simple Code so i can Understand what Code should i type to have Buttons on my Game cause i want this to play on Android phone sir Help please :D thankyou i HOPE YOU SEE THIS :D
About the "bug" issue i kinda used a different, less programming way, to fix it. At the Player script inside the Update() inside the the if where we check health
How do I make this into touch controls
So they've now replaced UnityEngine.UI with UnityEngine.UIElements. and UnityEngine.UI.Text with UnityEngine.UIElements.TextElement, basically TextElement istead of Text in the declaration. however healthDisplay.text doesn't seem to raise an error. Using the above mentioned changes removes the fields from the inspector for some reason. I changed the code back to UI and Text as shown in the video and it works. VS Code still shows an error tho. My movement was also disabled for some reason when i used the changes mentioned above. Why is that? Love the video, very easy to learn and is quite captivating! Cheers :)
How i can put two button for android?
The script for the score is not working,doesn't show in Console,what should i do?
How do you download this project into unity, iam having a hard time downloading the project
What if I create a new scene for a starting menu ?
hey bro is this turorial is for android or not ??
the score UI is not working can you help?
how can i play it on android? controller?
Sometimes my Character looses 2 health when touching an obstacle do you have an idea why this happens?
@mujahidahamad515
5 жыл бұрын
Enable Collision detection to continuous