How To Make PONG in Unity! [FULL GAME TUTORIAL]

Поделиться
HTML-код
  • Опубликовано: 20 дек 2024

Комментарии • 69

  • @AlexJDev
    @AlexJDev  Год назад +7

    Hi! I haven’t uploaded in a while but am looking to get back into the channel *soon*.
    Thanks for all the feedback, my apologies for how small the text is in vscode. Will definitely look at changing this next time!
    My style is going to change to more of a devlog with all code provided via GitHub at the end :)

    • @blacknwhite1313
      @blacknwhite1313 11 месяцев назад

      thanks Respected tutor

    • @danthon1267
      @danthon1267 6 месяцев назад

      Hope you come back soon!

    • @prerananayyar1953
      @prerananayyar1953 6 месяцев назад

      @@danthon1267do u know what he used to when he set up the project like a 2d or 3D

  • @mangineer_rl
    @mangineer_rl Месяц назад

    Geniunely, taught be so much about those damn voids that I didn't understand at all. great video all-around

  • @jakefagan2564
    @jakefagan2564 Год назад +6

    This was the best tutorial I found, in terms of the final result. Especially the way you set up the yDirection, in that it relates to the bounds of the paddle!

  • @mjagatkar88
    @mjagatkar88 8 месяцев назад +3

    Ball ❌️
    Bull ✅️
    Thank You for this tutorial 🙏🏽

  • @k1ng.Gaming
    @k1ng.Gaming 2 года назад +5

    I recommend this tutorial! It was a good one (the best so far) I searched for like 2 hours and finally found yours! it helped me a lot THX!

  • @paulembleton1733
    @paulembleton1733 3 месяца назад

    Decided to recreate Pong with extras. I know Unity basics and I’m an experienced developer so didn’t look at any tutorials. Now checking tutorials after finishing basic game and liking those that did much the same as me so that’s a 👍 for this one.
    Only criticism, if ( isTutorial ) playBackgroundMusic = false;

  • @casetern1610
    @casetern1610 4 месяца назад +2

    Such a good video with best explanation!!! You got a new Subscriber and hope so you will start posting again :)

    • @AlexJDev
      @AlexJDev  4 месяца назад +1

      Thanks man! I’m working on a new video and should be regularly uploading soon!

  • @SunnyNightmares13
    @SunnyNightmares13 7 месяцев назад

    Thank you so much it took a while to figure out what was going on but I made the game with your help thank you

  • @ephraimcarter7918
    @ephraimcarter7918 9 месяцев назад +1

    Amazing video! I followed it and felt like I learned so much, however, the music drove me crazy.

  • @garrettblackard2288
    @garrettblackard2288 9 месяцев назад

    i only have one tip. ctrl mouse wheel in vs. had to break out my magnifying glass.
    but great stuff i needed the platform movement for something

  • @TiredEyesStudio
    @TiredEyesStudio 6 месяцев назад +2

    Just wanted to share my stupidity here lol when I got to the Invoke method part of typing in Invoke("StartBall", 2f); and it wouldn't work meaning the ball never moved. I went back to see if I missed something, and I was like "I literally did this to the tee! So what the fuck is the problem here?" I spent the last three days learning all that I could about the Invoke method and its limits and even coroutines, and a couple minutes ago I watched this video again and realized....I typed in "Startball" instead of "StartBall".......I forgot to capitalize the B....and then the ball moved lmaoo three days to just figure out it was that. Wanted to share that. Great video! My mistake helped me learn more.

  • @MrBooBooOfficial
    @MrBooBooOfficial Год назад +1

    Also, when the ball hits my side, the counter doesnt go up... why?

  • @danthon1267
    @danthon1267 6 месяцев назад

    Congratulations! You got a new subscriber! Now you have 158

  • @Florea-on2zk
    @Florea-on2zk 11 месяцев назад +1

    I've written the player movement script exactly the same but the movement: isAI: and Movement Speed: are just not showing up as variables. What have I done wrong?

    • @SmallMine1
      @SmallMine1 11 месяцев назад

      Same happened to me

    • @evangelinaaron906
      @evangelinaaron906 5 месяцев назад

      make the isai and movement speed public!

  • @37dot3
    @37dot3 5 месяцев назад

    text doesnt change when i make a goal and the ball doesnt resets sorry for my english im german

  • @bigde8538
    @bigde8538 11 месяцев назад +1

    its not even letting me import the files (sfm all over again)

  • @MrBooBooOfficial
    @MrBooBooOfficial Год назад +1

    What's the background music?

    • @mrbruh2460
      @mrbruh2460 Год назад +1

      otherside from minecraft

  • @savagecatdev
    @savagecatdev Год назад +1

    love the minecraft bg music

  • @madmajima33
    @madmajima33 Год назад +1

    My player doesnt move when i press any keys did i do something wrong

    • @reps2564
      @reps2564 Год назад

      did you fix it?

    • @madmajima33
      @madmajima33 Год назад

      @@reps2564 no i gave up especially since my uni switched to unreal engine sorry i cant provided tips

    • @henryxXfun_timesXx
      @henryxXfun_timesXx Год назад

      @@reps2564 If you are still working on it
      change ("vertical") in visual studio code to ("Vertical")
      also make sure you go to (in the unity editor) edit => project settings => input manager => axes => vertical, and make sure that is is defined as Vertical and also that your "w" and "s" keys are binded
      hope this helps

    • @nox_208
      @nox_208 10 месяцев назад

      @@reps2564 try writing the code again
      fixed for me

  • @ryanatkinson3961
    @ryanatkinson3961 Год назад +1

    Is their a way of implementing a while loop to this so that it ends after the players or the AIs score reaches a certain number. And if there is could I have help with it please as I'm not sure how while loops work in unity. Thankyou in advance.

    • @chumleechumbucket6625
      @chumleechumbucket6625 Год назад

      you could put in if statements when it increases the score (more efficient than loops) and if the player/ai score is over a certain number you can run SceneManager.LoadScene(x); with x being the "name" or scene number. To use this, you'll have to state 'using UnityEngine.SceneManagement;' at the top. Then make 2 new scenes, one with some text saying you won and the other saying you lost, and maybe a replay button. I'm late to this and new to coding so you probably figured out something better already lol

  • @henryxXfun_timesXx
    @henryxXfun_timesXx Год назад

    Why does the ball stop dead on when it comes in contact with my racket or the wall?

    • @OINH17
      @OINH17 10 месяцев назад

      Have you addded the bounce physic to the gameObject?

    • @vandanavinni9132
      @vandanavinni9132 9 месяцев назад

      same here, can you please give the solution

  • @trancongvinh4998
    @trancongvinh4998 3 месяца назад

    Can I have the ball movement code ?

  • @ivanbecerragalvan798
    @ivanbecerragalvan798 11 месяцев назад +2

    Thank you so much!!!!!!!😀😀😀

  • @EkremKaya-zn3mb
    @EkremKaya-zn3mb Год назад +1

    why font so small,i can not see anything

    • @yahyabzl1112
      @yahyabzl1112 10 месяцев назад

      Click on playerscore/ aiscore and make the scale bigger

    • @RicFF13
      @RicFF13 6 месяцев назад +1

      Womp womp

  • @jaidinwynn6584
    @jaidinwynn6584 8 месяцев назад

    My ball wont start and I’m not exactly sure why. I have no error in my code but it just won’t work

    • @Factland_
      @Factland_ 5 месяцев назад

      Make sure u wrote the function name correctly

  • @ali_afsharnjd
    @ali_afsharnjd Год назад

    This tutorial Was awsome Thank you so much

  • @ghoste2755
    @ghoste2755 Год назад

    Besides the fact that you went a bit fast, and I got confused a couple times, I've had this issue so many times before, its not detecting the collision

  • @ClassicBee17
    @ClassicBee17 11 месяцев назад

    Why can I not move my paddle at all?

    • @chasehicks6520
      @chasehicks6520 10 месяцев назад

      make sure vertical is capitalized "Vertical"

  • @Plebzzz
    @Plebzzz Год назад +1

    Hey, for some reason the "AI" Moves when I do, what did i get wrong here?

    • @jaylicious4694
      @jaylicious4694 Год назад

      I had the same problem, I had to change the gameobject in player controler script to none and leave it only for the AI and then it worked

  • @eduardovarela4176
    @eduardovarela4176 Год назад

    the ball does not bounce, I have everything the same

    • @SPACESOFT_GAMES
      @SPACESOFT_GAMES Год назад +1

      Add physics material in ball's collider

    • @icydreaded1717
      @icydreaded1717 Год назад +1

      @@SPACESOFT_GAMES thnx this was really helpful

  • @Reklaw096
    @Reklaw096 Год назад

    It is not doing the scoring part it just bounces off of it

    • @chumleechumbucket6625
      @chumleechumbucket6625 Год назад

      if it's bouncing off the sides, it means that the 'startball' function isn't even triggering. It might be because you used onCollisionEnter instead of onCollision2D, or you might've messed up setting the triggers themselves. if you're talking about the paddles they're changing the speed not the score. vague question tho

    • @Reklaw096
      @Reklaw096 Год назад

      @@chumleechumbucket6625 ya sorry it is speeding up by the paddles but when it hits the walls behind the paddles it does not change the score or reset

    • @chumleechumbucket6625
      @chumleechumbucket6625 Год назад

      @@Reklaw096 in that case it either means you didn't set up the triggers or the ontriggerenter function properly. Double check that they're both set to 2D, that can be an issue

    • @Reklaw096
      @Reklaw096 Год назад

      @@chumleechumbucket6625 ok thanks I will try to see if that works later

  • @anfrollex
    @anfrollex Год назад +2

    I'm blind like a mole, why didn't you make the code's font bigger 😑
    But thank you tho, I'd been searching for this part with the ball going any direction depending on the angle!

  • @LeeKatsuOfficial
    @LeeKatsuOfficial 5 месяцев назад

    4:27

  • @KurooNegai
    @KurooNegai Год назад +1

    Bro why? Tutotial is good but I can't see any codes? they are very smaii

  • @mikeygaming1233
    @mikeygaming1233 Год назад

    hi

  • @ivanobosnjak2134
    @ivanobosnjak2134 Год назад +5

    really bad tutorial. you're going too fast and dont explain half of the things...

    • @2010platinumstar
      @2010platinumstar Год назад

      This was pretty easy to follow for me. You can rewind if you miss something.

    • @ivanobosnjak2134
      @ivanobosnjak2134 Год назад

      @@2010platinumstar At the time, I didn't really understand C#, because I thought I don't really need much knowledge about it because C# and Unity's C# are somewhat different. From then I've finished with learning C#, but I gave up on Unity because of the newest update. So, I would say that my lack of understanding C# did a pretty big part in not knowing what to do, but I can't really say he did a great job on this video.

  • @s1xpackch1ck
    @s1xpackch1ck Год назад +1

    For some reason whenever I add a collider to my background it ruins the ball movement, but then ball movement is normal without a collider on the background, I don't know what is happening with the interaction between the two

  • @t.mahesh6365
    @t.mahesh6365 2 месяца назад

    I tried this , but in game ball doesn't move until I tried to move it by scene what problem is this