How to make Pacman in Unity (Complete Tutorial) 🟡🍒

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น • 243

  • @Zigurous
    @Zigurous  3 ปีที่แล้ว +10

    Visit the GitHub page for the most up to date source code: github.com/zigurous/unity-pacman-tutorial
    View the FAQ for answers to common questions: github.com/zigurous/unity-pacman-tutorial/wiki

    • @Zigurous
      @Zigurous  2 ปีที่แล้ว +2

      Note: the line of code this.enabled = false; in the Awake function of the GhostBehavior script should be deleted to prevent a race condition. Removing this line of code won't cause any other issues, and it was a mistake on my part.

  • @spencerroach4489
    @spencerroach4489 2 ปีที่แล้ว +68

    This tutorial was comprehensive for a beginner like me. I genuinely appreciate the time and effort you put into it. Thanks!

  • @larrypendleton8195
    @larrypendleton8195 3 ปีที่แล้ว +30

    I can't thank you enough for this tutorial. This is as close to a one-to-one pacman original game remake that I have ever seen. I learned some some really good concepts throughout this tutorial, especially like the sprite rotation using Atan2 & AngleAxis, really good stuff. Please continue doing these tutorials. Thank you once again for all your hard work.

  • @flavioestelato2413
    @flavioestelato2413 3 ปีที่แล้ว +16

    I started to code games in unity and had an idea to make all famous video games chronologically. And your channel just fits me perfectly.
    I just want to thank your great work, keep doing this awsome content!

    • @pr0newbie
      @pr0newbie 2 ปีที่แล้ว +3

      That's a wonderful idea. How's it coming along?

  • @AnthonyVolpe
    @AnthonyVolpe 3 ปีที่แล้ว +14

    Once I get more familiar with Unity, I’m totally coming back to these videos.
    Given the fact that this video is two hours longer than the prior one, I’m almost afraid to suggest your next tutorial, but my vote goes to either Berzerk or Robotron 2084.

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +8

      I appreciate the suggestions, I'll keep them in mind!

    • @kpm25
      @kpm25 3 ปีที่แล้ว +2

      @@Zigurous Or 1942! or even Tetris :)

    • @foncode101
      @foncode101 3 ปีที่แล้ว

      Street Fighter 2

  • @ockley
    @ockley ปีที่แล้ว +2

    At 21:30. You can also click the eye on the wall-layer to see if there is pellets hiding underneath. Thank yoy for some interesting tutorials.

  • @UA_stud
    @UA_stud ปีที่แล้ว +17

    If you're like me, you immediately begin debugging if something doesn't match. If Pacman does not collide with the walls like he does in the video, just wait a few more seconds and let him explain the next few steps before you panic and debug for an hour... been a great tutorial though!

    • @astropgn
      @astropgn ปีที่แล้ว

      lol! I was like "what? Pacman, come back, you drunk!"

    • @sbboh-kcin
      @sbboh-kcin 9 หลายเดือนก่อน

      well looks like im like you. this should be top comment haha

  • @silentryu9566
    @silentryu9566 2 ปีที่แล้ว +2

    Be sure about 1:26:00 if your input isn't working correctly, I had to make sure my methods in the movement script were referencing the correct "direction" variable. If that makes any sense.

  • @matopulos5146
    @matopulos5146 11 หลายเดือนก่อน

    Very nice Tutorial, i made this game from my own, but couldnt figure out how to handle the Movement of the ghosts. Your tip with Nodes as TileMap Tiles was very nice and easy to understand. Thank you so much!!

  • @lolypop1379
    @lolypop1379 3 ปีที่แล้ว +5

    Fun Fact: At the time of writing this comment all of your videos have only 1 dislike and so many likes it means your videos are amazing.

    • @toastbot8663
      @toastbot8663 3 ปีที่แล้ว

      Fun Fact: 3 months later, still just 1 dislike :D

    • @DashCurran
      @DashCurran 11 หลายเดือนก่อน

      @@toastbot8663 Fun fact: 2 years later, there is no dislike counter :D

  • @yanivavrahami842
    @yanivavrahami842 3 ปีที่แล้ว +11

    Man you must continue with these tutorials they are awesome, try to upload more often and I am sure you will become successful! thank you so much!

  • @AshleyDavis-v5f
    @AshleyDavis-v5f ปีที่แล้ว +3

    At 1:17:00 - I was really confused because I my PacMan was moving through the walls. But if you keep watching he will help you fix it!

  • @macobits
    @macobits ปีที่แล้ว +6

    The tutorial has been great so far. I had to change the position of the Connection_left/Right gameObjects in order to make the passage work (from -13.5 to -13 / from 13.5 to 13). If I don't do it, Pacman gets stuck in a loop moving from one passage to another. I guess the rigidbody physics are more sensitive in Unity2022.3.8f1? Did anyone else have this problem while making the passage?

    • @creamsn3
      @creamsn3 ปีที่แล้ว +5

      I have the same problem here! But already solved it. I move the Passage object just a little bit farther with the Connection so that will be work. For example, the video said the position of X Axis Passage_Left is -14.5, so I just move it into -15.5

  • @tayfunyirdem
    @tayfunyirdem 3 ปีที่แล้ว +1

    AWESOME! Best game development series i've ever seen.

  • @jimdigriz5391
    @jimdigriz5391 3 ปีที่แล้ว +1

    I don't even like Pacman, but I'm surely enjoyed this tutorial.
    Keep up the good work!

  • @marztecheque
    @marztecheque ปีที่แล้ว

    @21:30 etc - re: accidental pellets "under walls" - you can always uncheckbox in inspector to turn off each tile map, say the walls one - to see just the "pellets" and then vice - versa - a nice easy check to see if there's strays, overlaps etc - and then checkbox on like default cheers thanks nice tutorial overall

  • @captainkeller2792
    @captainkeller2792 3 ปีที่แล้ว +5

    Man your Channel is just cool.

  • @Draysito
    @Draysito ปีที่แล้ว +1

    El mejor tutorial de pacman que hay en youtube

  • @shanghai_gezgini
    @shanghai_gezgini 3 ปีที่แล้ว +6

    How to Install 2D Tilemap Extras, Check below:
    1.Install Unity 2020.1 or newer.
    2.Make sure that Preview Packages are visible by opening Project Settings, going to the Package Manager section, and checking Enable Preview Packages.
    3.Open Package Manager by going to Window > Package Manager
    4.Choose Tilemap Extras from the list and click on Install at the bottom right of the Package Manager window.

    • @JoshAbens
      @JoshAbens 3 ปีที่แล้ว +1

      thanks!

  • @astropgn
    @astropgn ปีที่แล้ว

    I made the commitment to do this game following this tutorial. I will take my time, pausing and doing, taking notes... Totally not rushing it. I am 30 minutes in, where he starts scripting. This is going to be fun!

  • @Funny-ky3tw
    @Funny-ky3tw 3 ปีที่แล้ว +4

    Nice to see you again! Another cool tutorial with one of best old school game)
    Have a little dream in one day I will see tutorial of Bomberman or Prince of Persia from you)
    Thank you!

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +10

      Oh, Bomberman would be really fun! I used to love playing that game.

    • @captainkeller2792
      @captainkeller2792 3 ปีที่แล้ว +3

      Oh yeah Bomberman sounds really nice.

    • @space9kris
      @space9kris 3 ปีที่แล้ว +2

      @@Zigurous Dude bomberman would be awesome!!

  • @justteresiah
    @justteresiah 2 ปีที่แล้ว +1

    This was really enjoyable and straightfoward, I learnt a lot.

  • @Saksham0412
    @Saksham0412 2 ปีที่แล้ว

    Just a space killing whole project on 2:21:20 !!! damn!!
    and Adam you found that in an instant :o

  • @fall3nworldstudios
    @fall3nworldstudios 2 ปีที่แล้ว

    I am here for the pacman movement implementation...thank you so much!

  • @asher.hansen
    @asher.hansen 3 ปีที่แล้ว +1

    man your so underated surely you hit 1 million subs one day

  • @astropgn
    @astropgn ปีที่แล้ว +2

    1:28:44 If I make the connectors exactly -13.5 and 13.5, Pacman will go back and forth in an infinite loop. I had to offset some pixels (like -13.1 or 12.9) to make it work. I don't know why 13.5 didn't work, since it works in the video.

    • @jangdepiyush
      @jangdepiyush 7 หลายเดือนก่อน

      same issue with me I set it to -12.5 and 12.5

    • @astropgn
      @astropgn 7 หลายเดือนก่อน

      @@jangdepiyush I never figured it out what happened, but the new value worked for me. It might have something to do with framerates or resolution. Who knows? lol but it worked it out, good luck on the rest of your project!

  • @kbikiro9728
    @kbikiro9728 2 ปีที่แล้ว +2

    Great tutorial keep up the good work, you're going to help a lot of people that are seeking for opportunities to gain experiences !

  • @tanushrmenon
    @tanushrmenon 2 ปีที่แล้ว

    This was uploaded on my birthday nice

  • @diegoalejandropuertolopez1527
    @diegoalejandropuertolopez1527 3 ปีที่แล้ว +2

    Thanks so Muchhhh, please do more videos like this

  • @janisbruchwalski8689
    @janisbruchwalski8689 3 ปีที่แล้ว +1

    Very nice Tutorial. Learned a lot. Thanks!

  • @gabdev2891
    @gabdev2891 3 ปีที่แล้ว +1

    Amazing Tutorial

  • @D7E_
    @D7E_ 3 ปีที่แล้ว +14

    I don't know how to express my thanks to you for your interesting lessons and the effort you made to explain in the easiest way. I will thank you in our own way as programmers 👀
    While (true)
    {
    Print(“Thanks Adam🌹”)
    }

    • @luxonslayer5154
      @luxonslayer5154 2 ปีที่แล้ว +1

      u forgot to put the semicolon ";";

    • @D7E_
      @D7E_ 2 ปีที่แล้ว

      @@luxonslayer5154
      I used c#++ without;😂😂

    • @Jahvo.
      @Jahvo. ปีที่แล้ว

      @@luxonslayer5154 🤣

  • @Speedatan
    @Speedatan 3 ปีที่แล้ว +14

    Idea: A video of making TETRIS (pls)

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +9

      That'll be the next video!

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +4

      th-cam.com/video/ODLzYI4d-J8/w-d-xo.html

  • @foncode101
    @foncode101 3 ปีที่แล้ว +1

    Best channel ever!

  • @gilesaspin7083
    @gilesaspin7083 2 ปีที่แล้ว

    Great tutorial, easy to follow.

  • @mktwinsmovies
    @mktwinsmovies 3 ปีที่แล้ว +3

    So well done. Great explanations and elegant ways to organize code. Learned a lot as was newer to unity

  • @tak2218
    @tak2218 7 หลายเดือนก่อน +3

    So im at 2:56:00 and my ghost wont leave home, i also have ResetState error in PacmanEaten and " 'Ghost_Clyde' is inactive". How can i fix this?

    • @khalizto
      @khalizto หลายเดือนก่อน

      I have run into the same issue, except maybe a little different? None of my ghosts won't leave home, and I get this error message
      "Coroutine couldn't be started because the the game object 'Ghost_Clyde' is inactive!
      UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
      GhostHome:OnDisable () (at Assets/Scripts/GhostHome.cs:12)"
      Have you found a solution?

  • @jeremyadriel1509
    @jeremyadriel1509 3 ปีที่แล้ว +2

    Nice video bro

  • @asrnylmaz4057
    @asrnylmaz4057 3 ปีที่แล้ว +2

    You should continue to this thype videos i hope u do nice video

  • @tomassaviory2417
    @tomassaviory2417 2 ปีที่แล้ว

    Thank you my brother. This helped a lot!!! God bless you.

  • @tranhuuphucan4500
    @tranhuuphucan4500 3 ปีที่แล้ว +3

    Great video, helped me a lot, but I think that the chase behaviour could be improve using dijkstra to find the path or else it would bug when the ghost and pacman stay between 2 nodes but on different y, this should cause the ghost to go back and forth if pacman does not go out of that area, but for an educational video, very great work!!

    • @hani8261
      @hani8261 3 ปีที่แล้ว

      Hi were you able to implement dijkstra in your chase behaviour? If so, could I please see your code as I have been trying to implement it but am struggling

    • @tranhuuphucan4500
      @tranhuuphucan4500 3 ปีที่แล้ว

      @@hani8261 I have been very busy since then so I weren't able to implement it, but I can tell you my idea. I simply treat each turn and crossroads as a node and pacman as a node also, then you can perform djkstra to find the optimal direction for the ghost to move , I reccomend performing the algorithm or updating the direction each second to optimize the game. I hope this help you, and if you can please tell me if you got it.

  • @tpg7650
    @tpg7650 ปีที่แล้ว

    I love Pac-Man.

  • @jaycn4115
    @jaycn4115 3 ปีที่แล้ว +1

    Thank you so much bro.

  • @Saksham0412
    @Saksham0412 2 ปีที่แล้ว

    Awesome :) and thank you

  • @ngocthang4897
    @ngocthang4897 ปีที่แล้ว +1

    Sorry, I want to ask some question: At 49:00 Why don't we use Animation and Animator in Unity?

  • @ridans517
    @ridans517 2 ปีที่แล้ว +2

    Great guide! I have just one question, are you using any Unity extensions for Visual Code that might be good to have?

    • @originalvirgo1
      @originalvirgo1 ปีที่แล้ว +2

      I'm using 'Neon Vomit Color Theme' - Your code pops
      and of course the 'C#' one

  • @ЮрийЮгай-ъ3ж
    @ЮрийЮгай-ъ3ж 2 ปีที่แล้ว +2

    Hello. For some reason, when I press the control buttons, they do not work. What could be the reason?

  • @stoic_poppyseed
    @stoic_poppyseed 3 ปีที่แล้ว +1

    Great movies, keep it up. Maybe the next game will be super mario bros?

  • @_jack1e_986
    @_jack1e_986 3 ปีที่แล้ว +2

    Bro ! Would you like to make Tetris ? This video is very awesome

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +2

      th-cam.com/video/ODLzYI4d-J8/w-d-xo.html

  • @claudio5012
    @claudio5012 3 ปีที่แล้ว +2

    I really like your work.
    However i think youtube want people end your video to get monetized...so i suggest to split your videos in more affordable sections...ihmo
    i'd like to see dig dug (or Pooyan if i can dream) :D

  • @StygianStyle
    @StygianStyle 3 ปีที่แล้ว +3

    This is one of those games where you could spend $1000 in quarters and still not get very good at it. The worst most difficult, though, was Asteroids. Trying to control the flight and rotating to shoot only with buttons and no joystick. Maddening.

    • @turkeyjerkey
      @turkeyjerkey 2 ปีที่แล้ว

      You should try the old arcade Rip-Off game. Same type of flight control and shooting (but of enemies trying to steal a collection of cargo you're defending), but with increasingly difficult enemy ships and with the addition of a cooperative 2nd player who you could also accidentally shoot. lol

  • @willparke6509
    @willparke6509 2 ปีที่แล้ว

    Great tutorial! Just checked the FAQs and comments but it doesn't look like this others have had this problem before.
    I am having an issue where PacMan is sometimes missing a turn. For example: PacMan is in the very bottom left corner moving left to right. I press the up arrow in order to have pacman turn up the next open path. Sometimes pacman will skip the first open path and turn up the next one. Sometimes pacman will even skip the first 2 paths that are open for the "next direction" and go up the 3rd one. Other times, pacman will correctly go up the first available path.
    I do not think this is an issue with some paths being too small or having some other type of collider blocking entry. The paths that pacman skips are also paths that it won't skip other times.
    This is never a problem in areas where pacman collides with a wall and has to change direction. In this case, pacman will always go the correct way determined by the next direction set from user input.
    Do you have any insight into what the problem might be or how to fix it?
    Given the inconsistency, it seems like an issue with the update / fixed_update functions simply missing when the raycast determines an open path. Perhaps because Pacman moved right past the open path before the function got called.

    • @kbikiro9728
      @kbikiro9728 2 ปีที่แล้ว

      Hi, I think you should add another box collider component to Pacman with trigger checked.
      and make some of customizations to occupied() method as following :
      this.transform.position -> boxCollider2D.bounds.center
      Vector2.one -> boxCollider2D.bounds.size.
      return hit != null; -> if(hit.collider != null) {return false} else {return true;}
      don't forget to assign boxcollider in Awake() as following:
      boxCollider2D = transform.GetComponent();

  • @gamedev4894
    @gamedev4894 3 ปีที่แล้ว

    Loved this one. But for some reason on ghost home behavior, inky and clyde would bounce inside the house as they should, them they would move as intended to exit the house in an "L trajectory" but would snap back to their original position and move diagonally to the "Outside" game object. Gonna make some more debugging and see if I can find what is happening.

  • @JuanDavidArtal
    @JuanDavidArtal 2 ปีที่แล้ว +4

    When I reach the scatter behavior part, my ghost starts colliding randomly with the walls and eventually it get stuck. I check and its position is moving in tiny decimals. What could be a solution to this problem?

    • @JuanDavidArtal
      @JuanDavidArtal 2 ปีที่แล้ว +1

      I found the problem. It was that I forgot to assign the obstacle layer to one of the scripts in the ghosts (I don't remember which one)

    • @Radooku
      @Radooku 8 หลายเดือนก่อน +1

      @@JuanDavidArtal THANK YOU! Spent way too much time trying to debug that. For anyone still having this problem it was the Movement script on the Ghost_Base prefab

  • @poggle_Galaxy
    @poggle_Galaxy 3 ปีที่แล้ว +2

    Cool

  • @Toskan
    @Toskan 3 ปีที่แล้ว

    This tutorial helped me so much!! Could you explain how to make different IA for the other ghosts?

  • @reubenoakley8967
    @reubenoakley8967 3 ปีที่แล้ว +6

    When I went to first test the movement script, Pacman did not stop when he hit the wall. I placed a square with a box collider in his way, and he did stop when he hit that. I went through the part where you built the walls to make sure my settings were all correct, and everything seems to be the same (including the collision matrix (collision is active between the "Pacman" and "Obstacles" layers) and the tile properties (collider type is set to "sprite")). Any idea why Pacman isn't colliding with the walls for me?

    • @johnturner9786
      @johnturner9786 3 ปีที่แล้ว +6

      I was having the exact same issue. Adding a Tilemap Collider 2D to the Walls seemed to work. He mentions the oversight at 1:17:45.

    • @reubenoakley8967
      @reubenoakley8967 3 ปีที่แล้ว +4

      @@johnturner9786 Ah! Thanks for pointing that out! Seems to me that with the magic of editing, he could've put that explanation earlier in the video rather than letting people get confused, but whatever. At least I can get back to this once I finish my current project.

    • @nofoo
      @nofoo 2 ปีที่แล้ว

      this comment helped me immensely, I was so afraid I did something wrong and had to start all over lol!!

    • @blessedponica8030
      @blessedponica8030 ปีที่แล้ว

      @@johnturner9786 Thanks a lot!

    • @ArtOfDying1029
      @ArtOfDying1029 ปีที่แล้ว

      @@johnturner9786 Much appreciated

  • @midniteoilsoftware
    @midniteoilsoftware 3 ปีที่แล้ว +1

    Couldn’t you turn off the tilemap renderer r the pellets tilemap since the GameObject has its own sprite? And wouldn’t that allow you to assign the sprite to the tile so you could see it in the pallet?

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      Yes, you are right. That is a good suggestion I will keep in mind if I run into that same problem again.

  • @Matthew_Singer
    @Matthew_Singer 10 หลายเดือนก่อน

    Great tutorial. I have found a problem.
    In open space, with only a few obstacles and not moving in a maze, the pacman can be offset, thus not actually being on the grid perfect ?
    I tried so many ways to fix this, but failed.
    I understand pacman fixes this problem by making everything confined into a maze, but would be great to see how u would tackle this.
    Maybe a more grid like snapping movement ?

  • @jacob.pattison
    @jacob.pattison 5 หลายเดือนก่อน

    If anyone is working in unity 2022 or above and your glitching out on the passages, move them slightly more in, not sure why this does this but it would probabalty have to do with any collider changes

  • @omarguzman1112
    @omarguzman1112 2 ปีที่แล้ว +2

    Question, why draw out the tile? Wouldn't it be easier to just import a whole scene as an image? Or is that not done on video games?

    • @kbikiro9728
      @kbikiro9728 2 ปีที่แล้ว

      yeah, it's possible and easier
      In fact i am using unity2017 so TileMap2D editor didn't work for me, so in that case
      I figured out a way to make my own level editor using Texture2D ...

    • @usercontent2112
      @usercontent2112 ปีที่แล้ว +1

      @@kbikiro9728 Why are you using unity2017?

  • @snrdell1449
    @snrdell1449 3 ปีที่แล้ว +1

    How many years have you been writing games and programming?

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +2

      I have been programming and makes games since 2012

    • @snrdell1449
      @snrdell1449 3 ปีที่แล้ว +3

      @@Zigurous I started playing the guitar in 2012. Now I sang a little, but it's hard to make money on it.
      It would be better if I studied programming in 2012. I didn't know anything about Unity at the time. It is difficult to understand programming. I am a beginner. He is now 28 years old. I want to try and it takes a long time. Thanks for your videos. I wish millions of subscribers.

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      @@snrdell1449 It's never too late to start! Keep at it, and you will gradually improve. Best of luck.

    • @snrdell1449
      @snrdell1449 3 ปีที่แล้ว +1

      @@Zigurous Thank you for your support.!!

    • @kbikiro9728
      @kbikiro9728 2 ปีที่แล้ว

      @@snrdell1449 It's great, Now you can make your own games with your own music !
      You don't have to worry, there are thousands of tutorials in TH-cam that will help you make any game you have been dreaming of :)
      It doesn't matter if you're not good at programing, Unity is providing everything you need.

  • @fede_vinc00
    @fede_vinc00 6 หลายเดือนก่อน +1

    does anyone know why the ghosts defined in the "ghost prefabs" section don't move? If you change the layer from Ghost to Pacman they do. What can I do?

  • @Johan-rm6ec
    @Johan-rm6ec ปีที่แล้ว

    Your GhostChase has a bug, it won't go always towards Pac Man. To give an example, when pac man is in a top right corner and a ghost in chase mode has only an option to go left or go down it goes down. And then up again and down again etc etc. It makes the entire project obsolete because the most important script from this project isn't working.

  • @performante3481
    @performante3481 ปีที่แล้ว

    I would like to ask a question when disabling the visibility of the Pacman scene, the pellet map is still displayed how to fix it?

  • @fathanahzawiratama4902
    @fathanahzawiratama4902 2 ปีที่แล้ว +1

    In 1.44.43
    Why my pellets is respawn if i click button?

  • @Appathu
    @Appathu 8 หลายเดือนก่อน

    1:44:30 my pacman's not eating the pellets and score's not increasing as it should, can somebody pls help me out, i don't know where the problem is and its bothering me soo much

    • @jangdepiyush
      @jangdepiyush 7 หลายเดือนก่อน

      Check the layers of pellet and pacman

    • @Appathu
      @Appathu 7 หลายเดือนก่อน

      @@jangdepiyush i did, but still that doesnt seem like the issue because my pacman's just passing through the pellets and not eating them

  • @captainkeller2792
    @captainkeller2792 3 ปีที่แล้ว +1

    Well, I wanna thank you for a good time. :D . Took me around seven hours to finish this tutorial but I had a blast doing it and learned a lot. Also everything works fine now after searching for my errors. Thanks for taking the time to create this tutorial.
    Now its time to add my ui, some music and also change the tile map, because thats the only thing I used from the Github version. Maybe I also add some animations because that part I skipped entirely becasue I didnt wanna have to draw animations for my little duck while following the video. Atleast its not walking up side down anymore when I go left. ^^.
    Cant wait to see in what kind of game my duck will end up again but in the meantime it will go back to space. Shooting asteroids was fun but shooting space ships sounds more fun.

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      I appreciate you taking the time to go through the entire tutorial. I'm glad you learned a lot from it!

  • @reubenoakley8967
    @reubenoakley8967 3 ปีที่แล้ว +1

    I really appreciate these tutorials! I've been learning a lot better with them than I did with others that I'd used before. My only potential complaint is with using github for the file sharing. It works well enough, and perhaps I'm just not using it properly, but it doesn't seem to have a way to download folders. I didn't have much trouble individually downloading all the sprites for Asteroids, but for Pacman... well, it's a lot of clicking. I'll do it if I have to, but I'd really rather not. *edit* I figured it out. Apparently the green "Code" button (visible only while viewing the primary folder) is the download button. Seems like that could've been made more obvious, but oh well.

    • @MetalStormGames
      @MetalStormGames 3 ปีที่แล้ว

      You can just download the whole project from git up as a zip and then pick and choose what you want from it

    • @originalvirgo1
      @originalvirgo1 ปีที่แล้ว

      Green 'Code' button in the middle of the page allows you to download as a whole zip
      or just click on the individual folders, like you would in unity or windows etc. You can then download files individually as needed

  • @johnrasc6544
    @johnrasc6544 3 ปีที่แล้ว +1

    N I C E

  • @valuche5105
    @valuche5105 6 หลายเดือนก่อน

    Hi, I know this vid has been up for a while but I'm having issues with GhostHome. I basically copied everything down to the T but my Ghosts don't come outside of the home area at all. Do you know a solution?

  • @diamondgirly2126
    @diamondgirly2126 3 ปีที่แล้ว +1

    For some reason when the ghost is on GhostChase mode it goes back and forth on a node, doesnt matter wheere I move Pacman and the target is indeed pacman, any help? my code seems to be the same as yours in the GhostChase class

  • @justredmusic622
    @justredmusic622 27 วันที่ผ่านมา

    how do I get pacman to work on my android can't seem to get buttons on screen to work?

  • @travist1169
    @travist1169 2 ปีที่แล้ว

    With a node system already in play for the ghosts, is there a reason you didn't use this same node system for pacmans movements? Seems like it could have been much more lightweight?

  • @figbird9740
    @figbird9740 3 ปีที่แล้ว

    Amazing tutorial, thanks so much :) Having some problems with the GhostChase though - when enabled, the ghost will just alternate between the two closest nodes, backwards and forwards, rather than chase Pacman? I've checked everything but can't find a solution!

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      I remember having this problem when I initially developed the game. I think there are a couple possible causes.
      1. The ghost target transform might not be set correctly on the Ghost component. Normally speaking the ghost should be targeting pacman's transform. If for example, you set the target transform to some non-moving object this is an easy way to have the ghost ping-pong between nodes like yours is doing. This also seems relevant since the chase behavior uses that target position whereas not all other behaviors do.
      2. It's possible for this to happen if the navigation nodes have only one available direction, although I think this would still happen for other ghost behaviors too. Assuming you are not doing a custom level, every navigation node should have at least 2 available directions. In your Node script, you can Debug.Log(availableDirections.Count) to verify that none of the nodes have a count of 1. If this is the problem, then make sure you have set your layers correctly, including the obstacle layer on your Node component.

  • @jovillegas2983
    @jovillegas2983 2 ปีที่แล้ว

    Greetings! Thank you very much sir Zigurous for the tutorial video! May I ask a question? I followed the tutorial until 1:26:00 (The end of the player input part) however when I tested the game, pacman is not responding to any of my inputs. The movement is working like it is moving forward however the player input does not seem to work even though i followed the code and it compiled properly with no errors. Did I miss something?
    EDIT (As of March 2, 2022): I already found what the problem is. The circle collider of my pacman/player sprite is too small to recognize any boxcast on the obstacle on the grid. All I needed to do was resize the circle collider of pacman bigger until it exactly fits the grid and the input finally works.

    • @jovillegas2983
      @jovillegas2983 2 ปีที่แล้ว

      Also, how do I change the collider type of my sprites? I do not see an option like that in my wall tiles (as they are png files of sprites) however I see an option llike that on rule tiles.

  • @nanaexo-l920
    @nanaexo-l920 2 ปีที่แล้ว

    where did u apply the heritage and polymorphisme ( concepts of oriented-object programming ) in the code

  • @test-qm5vt
    @test-qm5vt 2 ปีที่แล้ว +1

    Hello Zigurous, great tutorial! I want to check what's the solution to Blinky not chasing Pacman after creating the GhostChase script. I have checked that the script is correct, added layers and tags correctly. Everything was working fine such as ghost changing direction when touched a node. However when it enters chase mode, it does not chase Pacman at all.

  • @mlockgamedev9090
    @mlockgamedev9090 2 ปีที่แล้ว +1

    Hey guys, great video. I have completed it until the end and am currently in the middle of changing the code and game features to make it into a custom game. The question i have is how would i change the script for pacman to allow the character to face the same direction it is travelling assuming its not a circle i'm using? All i have done so far is change the sprite on the gameobject for pacman but my new sprite is flipping upside down when its going Left or more specifically whenever the z axis is - 180. I have had a look online and there are different suggestions for it such as rotation(lookat) but every code i'm seeing is using the getinputaxis horizontal and vertical and i dont want to mess with this script by starting a whole new movement system. Any help would be appreciated. thanks :)

    • @mlockgamedev9090
      @mlockgamedev9090 2 ปีที่แล้ว +2

      Found a work around but i doubt this is efficient lol. Basically forcing unity to set the rotation and scale to make sure it faces the way i'm pressing.
      else if (Input.GetKeyDown(KeyCode.DownArrow))
      {
      this.movement.SetDirection(Vector2.down);
      transform.localScale = new Vector3(1, 1, 1);
      transform.localRotation = Quaternion.Euler(0, 0, -90);
      }
      else if (Input.GetKeyDown(KeyCode.LeftArrow))
      {
      this.movement.SetDirection(Vector2.left);
      transform.localScale = new Vector3(-1, 1, 1);
      transform.localRotation = Quaternion.Euler(0, 0, 0);

    • @originalvirgo1
      @originalvirgo1 ปีที่แล้ว +1

      Using negative scale is a great workaround, simple and no silly code. Nice

    • @marztecheque
      @marztecheque ปีที่แล้ว

      typically, you code for the "flip" in sprite renderer in inspector - so you import say facing "right" and leave it blank by default - then when you press "A" to go left, you set flip x/y to "active" ie. the checkbox becomes "checked" via boolean and then otherwise, it's then "off" again when not going left any more - but nice work on your replies cheers

    • @marztecheque
      @marztecheque ปีที่แล้ว

      another way for custom game - make custom "right facing" and "left facing" custom versions using free Krita drawing software - which has a "timeline" and you make say four frames - one version "left facing" the other version: "right facing" - then when you key input is "D" for right... you get the idea cheers

  • @foncode101
    @foncode101 3 ปีที่แล้ว +1

    Are you able to make a tutorial for street Fighter2? I would ball out if you did!!!!!!!

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว

      I'd like to do a game of this genre at some point, so I'll definitely consider it.

  • @eliassavv
    @eliassavv 8 หลายเดือนก่อน

    i am trying to solve a problem but i realy cant see any thing... i m doing everystep of the video and still there is an error...[error CS1061: 'GameObject' does not contain a definition for 'ResetState' and no accessible extension method 'ResetState' accepting a first argument of type 'GameObject' could be found]... i cant understand where is the problem with the ResetState on the 2:00:31 minute... please some one help its an emergency...

    • @jangdepiyush
      @jangdepiyush 7 หลายเดือนก่อน

      the problem is in ur code recheck if u have defined ResetState or not

    • @eliassavv
      @eliassavv 7 หลายเดือนก่อน

      @@jangdepiyush ive defined it in all 3 or 4 scripts im sure

    • @tak2218
      @tak2218 7 หลายเดือนก่อน

      ​@eliassavv did you mange to fix this? I have the same problem

    • @eliassavv
      @eliassavv 7 หลายเดือนก่อน

      @@tak2218 no i cant

    • @nurapixel
      @nurapixel 7 หลายเดือนก่อน

      I have the same problem as well

  • @aigo-sama4460
    @aigo-sama4460 2 ปีที่แล้ว

    Thanks alot

  • @actiongamemaster8082
    @actiongamemaster8082 2 ปีที่แล้ว

    what about the sound effects?

    • @brandon-tx4jo
      @brandon-tx4jo 2 ปีที่แล้ว

      Watch a tutorial on sounds

  • @userNoname543
    @userNoname543 ปีที่แล้ว

    my vcs don't see the Game object. where did you get it?

  • @bartoszf5043
    @bartoszf5043 3 ปีที่แล้ว +1

    Do we really need to reinvent a sprite animator in the form of a script when having an animation tool built in Unity?

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +3

      Using the built-in animation tools is completely fine too. Some people prefer doing it through code, others not. Neither is wrong. I personally find having a simple reusable script that I can pull into any project is easier and quicker to use, and it provides me more flexibility in some situations at runtime.

  • @umermirza27
    @umermirza27 10 หลายเดือนก่อน

    Which video to watch first then ??

  • @realiceslafix
    @realiceslafix ปีที่แล้ว +1

    1:37:02 only for time stamp i am using

  • @tpg7650
    @tpg7650 ปีที่แล้ว

    Bro how do I select all game objects?

  • @Dulu.bijuterias
    @Dulu.bijuterias 3 ปีที่แล้ว +1

    I would like watch you making Ikari warriors game….thanks.

  • @atulmore1445
    @atulmore1445 3 ปีที่แล้ว +1

    how to add github sprites to asset sprites in unity?

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      You have to download the full source from GitHub then drag the files into your project. In GitHub there is a green "Code" button with a "Download ZIP" link.

    • @atulmore1445
      @atulmore1445 3 ปีที่แล้ว +1

      @@Zigurous thanks man

  • @nykole.j7032
    @nykole.j7032 ปีที่แล้ว

    AnimationSprites: can change the code to be simpler with spriteRenderer.sprite = sprites[animationFrame++ % sprites.Length]; this will not overflow

  • @mr.jagoda8117
    @mr.jagoda8117 2 ปีที่แล้ว

    Great video but i do have a problem, once i like put my pacman in the direction ofa wall he just stops, how do i stop that?

  • @hardyhu9999
    @hardyhu9999 ปีที่แล้ว

    can you use unity 2021.323f1?

  • @darshansurti829
    @darshansurti829 ปีที่แล้ว

    I need help. My ghost are not turning when touching a node! I've ben working on this for days. Please help!

  • @onemanrushh7725
    @onemanrushh7725 3 ปีที่แล้ว

    Im stuck on the part where your making your own tile i do not see 2D tilemap extras and i can find a way around it (new to making games)

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      I would recommend using Unity 2021.1 or an even more recent version as it should come pre-installed with the 2D Tilemap Extras package. Otherwise you need to install it manually using the Package Manager window in Unity.

    • @onemanrushh7725
      @onemanrushh7725 3 ปีที่แล้ว

      @@Zigurous Thank you will try this out!👍🏽

  • @canaldolycanroccrepusculo4999
    @canaldolycanroccrepusculo4999 3 ปีที่แล้ว +2

    make a tutorial to add new ghosts and multi pacmans

  • @Khp_Gll
    @Khp_Gll ปีที่แล้ว

    I started following this tutorial a couple days ago and I ran into a situation. After I did the movement script, when I test run it, I get a 'NullReferenceException' error that takes me to the GameManager script, specifically to the Start, NewGame, NewRound and ResetState voids.
    What exactly does that mean and how do I fix it? Because that causing my game to be unplayable

    • @Khp_Gll
      @Khp_Gll ปีที่แล้ว

      UPDATE: Got the 'NullReferenceException' error fixed, but now I have another issue. I'm all they way up to the Ghost Home part and when I run the game, the 3 ghosts do move as intended but when they trigger to scatter/chase mode they don't leave the box and stay there.
      How can I fix that? I checked my prefab assets and scripts and everything seems to be ok

    • @Hadstar110
      @Hadstar110 ปีที่แล้ว

      Hi, I’ve got the same problem, they don’t leave the home. Did you manage to find a fix?

    • @tak2218
      @tak2218 7 หลายเดือนก่อน

      Hi, my ghost also doesn't leave home and I have ResetState error and ''Ghost_Clyde' is inactive'. Did you manage to fix that?

  • @hikmahalusmawati6408
    @hikmahalusmawati6408 3 ปีที่แล้ว

    Hello, I'm trying to make pacman games according to your tutorial on youtube, but I found a problem with the ghost prefabs, the ghost character doesn't appear on the game display and when played, but on the scene display it appears. please help me to solve the problem. Thank you.

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      It might be that the object is hidden behind something. You can try adjusting the sprite renderer component's "Sorting Layer" and "Order In Layer" properties, or you can even just change the z-axis position on the transform to set the order the objects render.

    • @hikmahalusmawati6408
      @hikmahalusmawati6408 3 ปีที่แล้ว

      @@Zigurous thankyou! I've been able to solve the problem. but, how to make the score and the number of lives of the pacman?

  • @philadelphiaaa
    @philadelphiaaa 3 ปีที่แล้ว

    It'd be very helpful if you could answer. It seems I've repeated after you and also checked the code several times still I have a problem with GhostScatter because blinky stops after encountering the very first node. Layers, as I see, set properly, box collider is triggered. I can't understand where the problem is.

    • @Zigurous
      @Zigurous  3 ปีที่แล้ว +1

      Maybe the ghost is not actually detecting collision with the node. I would put a Debug.Log(true) statement inside your OnTriggerEnter2D function in the GhostScatter script. If you see the log show up in your console then we know it is at least detecting collision which tells us the problem has to do with the logic instead.
      Some of the preconditions that have to be true for the logic to be executed is the behavior needs to be enabled, and the frightened behavior needs to be disabled. Double check those.
      Another issue could be within the Node script. Maybe the available directions aren't getting set correctly so after hitting the node the ghost doesn't know which way to go. You could Debug.Log the available directions to see what they are.

    • @philadelphiaaa
      @philadelphiaaa 3 ปีที่แล้ว +1

      @@Zigurous Thank you! I'll try

    • @willparke6509
      @willparke6509 2 ปีที่แล้ว

      @@Zigurous Amazing video! Quick question. I am having the same issue with Blinky getting stuck upon colliding with the nodes but I have already gone through and debugged according to your suggestions above.
      The logic for determining the available direction works as intended but here are the two scenarios playing out right now:
      1. Blinky collides with the first node. The randomly chosen direction is up and Blinky gets stuck.
      or
      2. Blinky collides with the first node. The randomly chosen direction is left and Blinky continues on to the next node. Blinky then collides with the second node. The randomly chosen direction is down and Blinky gets stuck.
      It looks like what is happening is Blinky's direction is being set before being perfectly inline with the path its direction has been set to. When hitting the first node, it works if the direction is set to be left because it is already perfectly positioned on that path. However, if it changes paths then the direction is getting set too early and Blinky's body collides with the obstacles / walls.
      I feel like the solution would be similar to Pacman's movement where you set the direction, queue it and raycast to check for when Pacman can actually fit between the walls of the desired path. I am just not sure why this is a problem for me but it isn't something you had to address?
      EDIT: Fixed. I forgot to set the obstacle layer for the movement script on each ghost. Thanks again for a great tutorial!

  • @sterling709
    @sterling709 3 ปีที่แล้ว

    i had the prefab ghostbase loaded with ghostscatter,ghosthome,ghostchase,ghostfrighten (ghostscatter being first) , when choosing initialbehavior for ghost, they do have all the 4 available option to choose ghostinky,ghostblinky,ghostpinky,ghostclyde all of the 4 are set ghostscatter as default, could u tell me how to change them , i wanted to allocate inky with initialbehavior with ghosthome rather then ghostscatter, thanks

    • @sterling709
      @sterling709 3 ปีที่แล้ว +1

      thanks.. i found it, i need to got to the prefab and choose inky and drag the script from the component box into it, . where i have been dragging the inky game object into it rather then the script component , even dragging the script itself from the project it doesnot allow , thanks