Image
Top
Menu
February 12, 2014

How to Flappy Bird — A quick tutorial on how to make a flappy bird style prototype using Unity + PlayMaker in under 50 minutes

  • noproblemnigel

    Hi, I’ve followed the 1st video tutorial but can’t seem to make the cube jump. the mouseclick event is firing but the cube doesn’t move. any idea why it’s not working?

    • http://www.plinan.com/ Brandon Wu

      That state looks ok (but you’ll want to add the Set Velocity action later as explained in the video). What does your idle state look like?

      • noproblemnigel

        Hi Brandon, my idle state looks like this. I tired downloading your Project files and importing the student Playmaker package. But I couldn’t get that to work either. Would it be because I installed the latest Unity (v.4.3.4) ?

      • noproblemnigel

        update: got it working!!! I bought Playmaker and now its working fine. must of been something with the student package…?!

        • http://twitter.com/theBrandonWu Brandon Wu

          Hmm interesting. Do you have any custom actions? I’ll look into that. But glad it’s working for you! :-)

          • bw

            I am having exactly the same problem. I’ve followed the steps for the first video and have checked to make sure all the settings match. Everything works, but can only get the cube to jump if I set the y of Add Force to around 200.

          • http://twitter.com/theBrandonWu Brandon Wu

            Are you able to try the latest version of Playmaker? that seemed to fix noproblemnigel’s project.

  • Alejandro

    thanks!!! soo god to share the all project…! is works!. But one question….why you don’t use a 2D tool of unity? and action of playmaker?.

    • http://twitter.com/theBrandonWu Brandon Wu

      That is my plan for the next step — transforming this into a 2D game with sprite animations. ;-)

      • Alejandro

        WoooW! so, when can you do that? I try to make but the player FSM is not work same like you game (or 3D mode).
        I use 2D toolkit and same playmaker action to move player when click the screen.
        I don’t not if the 2D mode is not work with this FSM.

        • Alejandro

          and…yes is not work when te camera is a tk2dCamera.
          :(

          • Alejandro

            here…the setup…if you know, pls tell me what happen!
            thanks!

          • http://twitter.com/theBrandonWu Brandon Wu

            I haven’t played around with 2D Toolkit much. When you say it’s not working, do you mean the jump isn’t working? You have a rigidbody on the player?

          • alejandro

            Nevermind….is works. The problem has when the camera 2d is set 1:1. So the solution is set the cameracamera 2d same as you setup your camera.

  • Humfleet

    Brandon i had a quesiton, how would you add in the rotation of the bird when he falls, and what can i do to fix the bug i am getting when the bird his the objects and if he hits it more then one time on his fall it flashes each time.

    • http://twitter.com/theBrandonWu Brandon Wu

      You can uncheck the fix rotation check box on the rigidbody for Z for it the rotate. The flashing is because the camera fadeout is tied to the trigger event I think so you can try to change it there (FSM on camera I believe).

      • Humfleet

        Thanks Brandon i will try the z thing, do you know how you would add in the score mechanic, when he passes the pipes and it adds one to a gui text?

        • http://twitter.com/theBrandonWu Brandon Wu

          You can add an invisible collider in between the pipes and make it a trigger. When the player exit the trigger, you add the score by 1.

          • Humfleet

            i tried this as well but when i try to add the trigger to the prefab for the obstacle, it would not let me add the gui text that i want to display the score on to the prefab

          • Humfleet

            do you think you could make another video on this or maybe some screen shots on how to do this, i am really now to playmaker so i am trying to learn as i go. thanks Brandon

          • http://twitter.com/theBrandonWu Brandon Wu

            I am preparing for the second class to http://skl.sh/SwBox6 and plan to cover a little bit on GUI. Maybe that’ll help. Probably won’t be able to do another video on this until after that…

          • Humfleet

            i will check this out, its 25 for your classes right?

          • http://twitter.com/theBrandonWu Brandon Wu

            Just saw this – yeah email me at brandon@pepwuper.com and I’ll send you a code ;-)

          • http://twitter.com/theBrandonWu Brandon Wu

            You’ll need another object to display the GUI, and update it from your FSM. Kind of hard to explain over comments – GUI by itself is a big topic for Unity ;)

          • Humfleet

            i have done this but it only updates after i stop the game from running it doesn’t update when the game is playing

        • Humfleet

          i tryed the z, and its not working i think you would have to add this in based on the velocity he falls at or something, maybe something like rotation based on falling speed, but not sure how to do that.

          • http://twitter.com/theBrandonWu Brandon Wu

            Unchecking freeze would only allow it to rotate if there are forces on the object. If you want, you can set the rotation manually in the state where he starts falling manually.

  • Thiago Brayner

    Very nice man, thank you!

    • http://twitter.com/theBrandonWu Brandon Wu

      Thanks for dropping by!

  • TTK

    Thank you for the great video!

    By the way, I have a question.

    When the bird passes through the pipe,

    I want to display a count of the number.

    To realize,

    Should I be using any action?

  • Pedro Nuno

    Hello,
    Could I make a question about your tutorial?.
    How would you make the player not jump if he passes a certain height of the screen?.
    In your tutorial the player never goes to the top. I know that I can put a collider but that would make things ugly because the player would just hit a wall and it would be better if the player just couldn’t press jump if it enters the collider. Could you explain to me on how to achieve this?.
    Thanks.

Posted By

Categories

Blog Posts, Misc.