Visit the GitHub page for the most up to date source code: github.com/zigurous/unity-pong-tutorial View the FAQ for answers to common questions: github.com/zigurous/unity-pong-tutorial/wiki
@nowthatsgaming5447 Жыл бұрын
20:53 how did you get the not equal sign?
@necroz08 Жыл бұрын
@@nowthatsgaming5447!=
@Critical3rror2 жыл бұрын
Small chance this will be seen for those of you using newer versions of the unity editor that use "TextMeshPro" in order to change the text you will have to use the TMPro library and make your text variables be "TMPro.TMP_Text" instead of "Text" then you can drag your TMP's into their corresponding places in the game manager object
@BoryslavMalishevskyi Жыл бұрын
your effort was appreciated!
@abadbitchwithdreads Жыл бұрын
Also change the using UnityEngine.UI to using TMPro. It should look like this ⬇️ using UnityEngine; using TMPro;
@morrymar3295 Жыл бұрын
it has been seen kind man
@Alex.Geornoiu Жыл бұрын
thank you very much for this!
@Stigma536 Жыл бұрын
how do i do that?
@MrMundharmonikah3 жыл бұрын
I've followed quite a few Pong Tutorials on KZbin now. Some were okay. Some I had to quit because they weren't well enough explained or had other issues. This one was by far the best. I like your calm, logical, almost OCD-type of explaining and showing everything in detail and cleaning up the code. I learned a lot just from this single video and feel encouraged to program my first game now. Thank you so much!
@hilmansantika48732 жыл бұрын
TNice tutorials is one of the best tutorials of ANYTNice tutorialNG that I've ever watched in my life! Thank you so much!
@space9kris3 жыл бұрын
Second one I've followed, after Snake, going to go through each one. I learned a lot from this and appreciate what your doing. I feel like these smaller games help me to understand the more basic principles. People ask for tutorials on complex games but if they learn how to code a bunch of simpler games, take notes and apply the principles on a bigger scale then eventually they will be able to work these larger ideas out themselves. Someone mentioned Bomberman and I think a Nes style bomberman game could be a really cool fit with the other videos. Keep up the good work and thanks for what your doing!
@reubenoakley89673 жыл бұрын
Hi! I just finished this tutorial, and I wanted to come down here to feed the KZbin algorithm for you! As someone who's just started using Unity and had essentially no prior knowledge of coding, I found this to be a fantastic way to learn and practice both. I've subscribed and will definitely be checking out your other videos, thanks a ton!
@kwipxd3 жыл бұрын
This has gotta be the best tutorial ive seen for unity, so easy to follow and your content is insanely high quality. Keep it up!
@michaelpuskar69752 ай бұрын
Appreciate your thoughtful and methodical tutorial. Around 24:00 a couple of notes: first, square magnitude cannot be negative, so a simple > 0 would be sufficient. Second, since the vector will only ever be changed on the y-axis, a more efficient method would be to just check if _direction.y != 0.
@tayfunyirdem3 жыл бұрын
AWESOME! Best game development tutorial series i've ever seen.
@jeremyadriel15093 жыл бұрын
Bro thanks for this tutorial , Its my first game that I creat in unity a you did a very googd job👌
@kylebelonoac38312 жыл бұрын
obsessed with soft design now and more obsessed with cool scales Nd stuff.
@ohmygigglez44643 жыл бұрын
Great tutorial! It really helped me out! I'm completely new to programming, and I've started and stopped Unity several times in the past because I just couldn't get my head around it and coding. Thanks to you I finally finished a project!
@ПётрЗиновьев-г1ж3 жыл бұрын
Great tutorial! Not only the tutorial itself is made with some quality, but the guy also takes some time to explain everything in detail. Looking forward to future videos :) Thanks!
@cool-aquarian2 жыл бұрын
Thumbnail got my expectations high, thought it was the usual ping pong across a table.
@maxriley17693 жыл бұрын
Incredibly useful content. You deserve views.
@jesusbarrios23232 жыл бұрын
It's great that there are people like you.
@sofiaanabela2 жыл бұрын
Blakey Don't stop making soft. I wished I started as early as you. You have a lot of years to learn!
@uniKorn83 жыл бұрын
Pong completed yesterday. Tutorial was very clear for beginner like me 👍 I even managed to create player 2 paddle script and replaced it with computer script today, can now play with a friend. Keep up the good work! next up Asteroids 🚀
@occularmalice Жыл бұрын
An enhancement you can do is to have the computer play against itself. You'll probably have to adjust the speed of each paddle so they're not so evenly matched (maybe by using a random speed) but all it takes is a minor change in the ComputerPaddle script. In the FixedUpdate method rather than determining if the ball is moving to the right (and thus it's moving towards the computer paddle so act accordingly) you can determine the direction of the ball relative to the paddle. Then you can act based on that instead, otherwise if you use the system as-is, the computer paddle will just sit idle at the center when it's on the left side of the screen. So instead of checking if(ball.velocity.x > 0f) you need to determine if the ball if moving towards or away from the paddle. This is pretty easy using the dot product of the relative velocity and the direction between the two objects. // calculate the direction from the ball to the paddle using the position of each object Vector2 ballDirection = transform.position - ball.transform.position; // calculate the relative velocity between the two objects Vector2 relativeVelocity = ball.velocity - rigidbody.velocity; // calculate the dot product of the two float dotProduct = Vector2.Dot(relativeVelocity, ballDirection.normalized); if(dotProduct > 0) { // ball is moving towards paddle } else { // ball is moving away from paddle } Now you can adjust the paddles y position accordingly regardless of where it is on the playing field. PS KZbin code comment and my brain syntax may be wrong Enjoy!
@jackhearts98272 жыл бұрын
Learning C# and Unity and this was so much fun and very easy to follow, thankyou so much.
@seanhunt49942 жыл бұрын
Hello everyone, I am new to programing. I got stuck on this video around 1:07 because we now have a newer version of Unity. I realized there was no (text UI icon). I figured it out if anyone else is having issues. Right click in the (Hierachy). On the drop down menu click on UI and select (Canvas). Once opened, select Canvas and right click to open a new empty game object. Make sure the new empty game object is a child on the Canvas in the Hierachy. Select your new empty game object. Change it's name to Player Score. Once opened, select add component (Text). That should place you back on track with this video. Very good tutorial thank.
@nabilraaa2 жыл бұрын
normally i dont give reviews but maam youre amazing
@raihanhossan56772 жыл бұрын
Thanks for the tutorial, it's much faster than any other method I came across.
@unsus3D14 күн бұрын
Thank you for this tutorial i learned a lot of things as a beginner.
@ferronferron91543 жыл бұрын
thank u very much this is my first project your helping a lot
@Liforus13 жыл бұрын
Best tutorial I've ever seen. Thank you!
@grandsuzuki3 жыл бұрын
Yes, I build my First game in Unity. Thanks for Explaning there is so mutch to learn. 😃
@dennischong79152 жыл бұрын
when i typed in soft soft tutorial i did not expect it to be tNice tutorials good thank you so much aaaaaaa
@theemeraldsloth95702 жыл бұрын
Just finished it. It was great. Thanks.
@CheeseWithMold Жыл бұрын
A clean, simple, and very relaxing tutorial! Well done and thank you!
@aussiedev59303 жыл бұрын
I added mouse paddle controller for mobile controls :), looking to set a max score for game over. I'll add extra features once I finished all your tutorials I might get some good ideas. Awesome tutorial.
@Saksham04122 жыл бұрын
hello could you help me that, like explain me how to script touch controls
@aussiedev59302 жыл бұрын
@@Saksham0412 use mouse controls they work for touch
@Saksham04122 жыл бұрын
@@aussiedev5930 u on linkdin or insta
@brisben883 жыл бұрын
Thanks for a great tutorial, hope your channel grows cause you've helped me a lot!
@sebastianantonelli91663 жыл бұрын
Best tutorial ever! Thank you for the learning experience!!!
@mrgoogle16782 жыл бұрын
TNice tutorials was great! the way you explain tNice tutorialngs and repeating it really helps. thanks for the tutorial!
@zingaali56422 жыл бұрын
Nice tutorial Michael,
@rockinrandalf2 жыл бұрын
Great Job, thank you, I've learned a lot. Please keep on uploading your high quality videos.
@agminga_yt61002 жыл бұрын
Thank you for your complete and comprehensive training. Very good!
@HKragh3 жыл бұрын
Having not seen the entire tutorial, it may be you address what I am about to comment on :) First of all, what a great series... I do however feel like in this the collision between the bats and the ball is wrong. In the original game the ball would always be sent back based on where on the bat it hit. So if the ball hits on the top of the bat, the ball will bounce upwards no matter what direction it has when it collides. Here it seems it is entirely a standard reflection you calculate. So the ball will always move around at the same angle in your version, and as a player you are not able to send the ball back from where it came. When I made Pong a couple of months back I defined a circle with a given radius (Still using the bats box collider as a trigger of a collision, but not reflecting), and then sent the ball back using this circle construct. Like if the bat was a circular curve. While I don't have the original game, it more close resembles what I see in videos showing the original.
@Zigurous3 жыл бұрын
You are correct. The collision here is actually not accurate to the original game. I'm going to be making a Breakout tutorial soon, which is very similar to Pong, in which I will implement the correct physics.
@claudionevesvideomaker39452 жыл бұрын
I checked - everything is clean
@mediatv1112 жыл бұрын
Best channel for Unity tutorial, thank you!
@SharifAlramahi2 жыл бұрын
Hey man thanks a lot. I was really overwheld and confused but now it all makes sense. Thank you.
@KHR01832 жыл бұрын
A very useful lesson for all aspiring softians
@adeelbashir8242 жыл бұрын
this channel deserves 1m+ subs
@CheetehZ3 жыл бұрын
awesome tutorial! Helped me make my first game in unity :)
@PrinceDade5 ай бұрын
Thank you so mucj man. I'm starting to learn how to code in Unity 3D and I should say that I love your way of explaining things. Did you do also any 3D game or only 2D games?
@slug77563 жыл бұрын
Thank you for taking the time to make this Zigurous! This worked for me with no issues. I used unity version 2020.3.14f1. Looking forward to going through the other videos!
@syedimaad3633 жыл бұрын
Just finished making this, thank you so much
@vaidyanathb3422 жыл бұрын
Thanks for this!!!
@dimitris01n Жыл бұрын
At 56:48 ball was bouncing in the same y level for ever probably. Any fixes?
@celestinofreitas3733 Жыл бұрын
thanks a lot for this tutorial it was one of the best things that I've seen, I've been trying to learn unity lately and this was a huge helper. :)
@casta90692 жыл бұрын
Thanks for the Video It encourage to get in Unity
@cerkezkoyfotodeniz10882 жыл бұрын
TNice tutorials is going in my helpful tutorials playlist.
@RazVlogs2 жыл бұрын
Thank you. Just started with Unity and this helped me a lot. Will continue to learn more from you.
@pronk.2 жыл бұрын
Fantastic video bro, legend.
@trankimnga44472 жыл бұрын
Thanks a lot - your video is a Great start to soft soft. I'm onto it !
@vitobrx2 жыл бұрын
This is a perfect tutorial. Thank you!
@zarawjoestar2 жыл бұрын
Nice video man, clear and concise explanation! Thanks a lot!
@АбдукадирКамилов3 жыл бұрын
Thank you good lesson I liked it very much I want more
@وليدالحربي-ك1ش2 жыл бұрын
No virus, real work
@gazzer44612 жыл бұрын
This is a really good and easy to follow tutorial. Thanks!
@scopez38532 жыл бұрын
TNice tutorials is video is amazing! thanks for posting.
@tomaszjoy55869 ай бұрын
Amazing tutorial. I have lernt a lot. Thank you.
@heintunzaw56912 жыл бұрын
do more of this!! this is amazing
@relarin952Ай бұрын
If forever reason at 18:00 you can't attach Player Paddle script to the game object, just take out the space in the name of the script and that should let it work fine!
@hatofuka80782 жыл бұрын
I tNice tutorialnk you speak for a good portion of us.
@juliangubbels52173 жыл бұрын
Learned a lot, thanks!
@EpicPoggy Жыл бұрын
can you tell me how you did the "does not equal" symbol at 23:48?
@vlasis. Жыл бұрын
You can do the same symbol by typing !=
@chanoohh24812 жыл бұрын
yours is perfect. These are going to takes loads of ti off the learning process.
@GimmickDW2 жыл бұрын
This method works perfectly .. thanks for sharing ;)
@smeagolfishy7 ай бұрын
Great tutorial, thanks!
@wckval68782 жыл бұрын
very very gooood, thaaankss maan✨✨✨✨✨✨✨✨✨✨
@SonNguyen-wi3nc2 жыл бұрын
Thank you Mike! I'm just starting out and tNice tutorials video really helped get the basics down!
@DUE12342 жыл бұрын
make more of these i like these kids keep it up
@carlraymarpuri83542 жыл бұрын
Installed, everything works, thanks! Like
@SRIRAMCHANDR9 ай бұрын
Learned a lot, thanks a bunch for your efforts...
@nine83363 жыл бұрын
Great video, thanks for help :D
@TheSteveTheDragon3 жыл бұрын
Really enjoying your tutorials. Would you consider doing a final-fight/streets of rage or river-city ransom style game in the future?
@Zigurous3 жыл бұрын
I'll certainly consider it! Those will probably be a little more advanced.
@josepmariamiradadonisa57052 жыл бұрын
Installed, everything works, thanks!
@instantlydrop53642 жыл бұрын
You explain it really very well. I thank you! Your video helps me a lot in learning.
@BoryslavMalishevskyi Жыл бұрын
i hope one day youll get a million subscribers:)
@alperen_1013 жыл бұрын
This kind videos so useful ,keep going same..
@bengisunalnc72952 жыл бұрын
Bro! it's Amazing You solved my problem! Thanks!!!
@Hugoishere09117 ай бұрын
thank you for the effort! Love your tutorial !
@jeremiahquintano45372 жыл бұрын
Thanks for explaining it really well! I've been putting off learning soft soft cuz it looks so intimidating but now that I easily understood the
@remonsebastian53702 жыл бұрын
thank u helped me a lotNice tutorial.... Very helpful
@macmartinez26 ай бұрын
Excellent video. THNKS😁
@yasseraltamimi61712 жыл бұрын
I'm glad I found your channel, I love the way you explain everything you're doing and at the same time not treating us as idiots by explaining the obvious as how other beginner tutorials do. Just a simple question, going by your structure of code, how would you go about implementing that at the beginning the ball goes random x and y, but when one side scores the ball goes to the who conceded and still in a random y?. I hope it's clear what I'm asking :) Thanks!
@zd3nnis8802 жыл бұрын
works perfectly, thank you
@WillyFanGirlOsu2 жыл бұрын
Hey man, It works great and without any problems.
@ameri1113 жыл бұрын
Hi I love the tutorial and am planning on adding a few extra features for personalization! do you know how I would go about to making it so the increasing velocity of the ball doesn't go past a certain value? If it goes past enough it just goes right through the paddle/rigidbody.
@Zigurous3 жыл бұрын
Before adding a force to the ball, check the speed is less than some maximum value you determine using an if statement. You can get the speed of the ball like so: ball.rigidbody.velocity.magnitude
@sachiyukinaa2 жыл бұрын
Cool! Downloaded))
@fakhrioficial80612 жыл бұрын
You are the boss bro!!! Thank you a lot!
@emsido59323 жыл бұрын
Bro you are amazing!
@supermoto1012 жыл бұрын
At 1:15.45, I am able to assign Game Objects for Ball, Player Paddle and Computer Paddle but not for Player Score Text and Computer Score Text. I know that in the hierarchy, these items are called Player Score and Computer Score. I tried renaming them to Player Score Text and Computer Score Text but this did not help. Any help appreciated.
@twinkalpatel38942 жыл бұрын
Hey, even I am facing the same issue, are you able to resolved it or not?
@MM-ye7og2 жыл бұрын
Thanks for the video, very helpful and well explained. Off to make so soft
@_FunkyDude2 жыл бұрын
When making the ball go faster with each hit, I noticed when you checked the velocity your ball starts off much faster than mine and even increases with each hit more than mine yet I have the same code. Could that be our machines? I'm running on 14' macbook pro 2021. Your velocity starts around 4-5 and increases around .2 each hit, Mine starts around 3 and increases by .1 Also why does the X value only increase with a paddle hit? Thank Man! Great Tutorial!
@_FunkyDude2 жыл бұрын
FIXED: For some reason I just have to adjust the bounceStrength values on the paddles and walls. Maybe its a machine difference issue, but switched to 25 on the paddles and 15 on the walls and feels much better.
@l0rdgeo4132 жыл бұрын
looking forward to learning from the rest of your v
@cliffhardy8431 Жыл бұрын
Hello. Thanks for the tutorial! It's really helpful and detailed. I'm having an issue getting the computer paddle to run the script. Right now it's now moving at all. I dragged the Rigidbody from the ball into the script component and I'm pretty sure the script is the same as in the video. Any ideas of what might be wrong?
@sta.josefaagusandelsur68782 жыл бұрын
willing to learn. Unless you already understand setups, then I gues sit's gonna be easier, but as a classically trained pianist I was blown
@savasozturk002 жыл бұрын
Great tutorial, I completed in 8 hours but learned lots of things. My advice for new ones is to follow videos carefully and implement immediately instead of copying and pasting the code from github. The cleaned code in github includes some errors and lacking parts, It's loaded without being tested. Now, I have a working Pong game and I'm ready to use it in my reinforcement learning experiments. By the way, zigurous's style of computer paddle intelligence is pretty successful indeed although it is very simple.