Unity Playmaker 2D Platformer - Player Jump and Ground Check

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

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

  • @BlizStudio
    @BlizStudio  3 года назад +1

    Check out my Runner Game Series Playlist teaching you how to make a base game and then turn it into all kinds of different games using Unity + Playmaker ruclips.net/p/PLhvjMi_0yrQzTgK-vhXDdi8OHBoCsx5D_

  • @RealNotaK
    @RealNotaK 3 года назад +4

    Finally! someone made tutorial on 2d Jump in playmaker THANK YOU SO MUCH 💖 You are the best playmaker RUclipsr 🙂

    • @BlizStudio
      @BlizStudio  3 года назад +1

      Thanks NotaK. Definitely lots more coming here.

  • @wrayth3951
    @wrayth3951 2 года назад +1

    At 4:06 you skip over connecting the transitions connecting ground check to Jump. Just an FYI.

    • @BlizStudio
      @BlizStudio  2 года назад

      thanks @wRayth. That might have been me being a little aggressive in the editing process. 😳😬 ( I wish I had a vid editor 😊).

    • @wrayth3951
      @wrayth3951 2 года назад +1

      @@BlizStudio Totally understood! Not trying to give you a hard time, just thought I'd point it out in case someone else went "?" haha. Thanks for the hard work!

    • @BlizStudio
      @BlizStudio  2 года назад

      lol. no worries. This is great info and a good catch for sure and much appreciated.

  • @BlizStudio
    @BlizStudio  3 года назад +1

    Check join my discord, post a comment here and I'll reply with the current invite link.

  • @astro_case
    @astro_case 2 года назад +1

    Super excited to try this out tomorrow! Thanks for this 🙌

    • @BlizStudio
      @BlizStudio  2 года назад +2

      I need to get back and add some more to this tutorial series. The drive that had that project on it failed so have to recreate =(

  • @SkyboundRhythms
    @SkyboundRhythms Год назад +3

    Hello, why is mine a double jump, can you help me🙏

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

      Yep, you need to make sure you do the step setting up that you can't jump again until the player has touched the ground first. Couple ways you can do that. You can do a raycast which is like a laser line and if that line touches the ground then you can jump again or you can do a collision detection of the ground. Let me know if you need more help. Also you can pop over to my discord (link up in the top pinned comment) and I can help there better.

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

      I solved this by changing the order of the states: Jump Input > Ground Check > Jump > Jump Input...

  • @CodexCornerGames
    @CodexCornerGames 2 года назад +1

    Thanks for the tutorial. I have a problem, my player seems to make a small jump before the actual jump and then going back to the original state. How do I fix this?

    • @BlizStudio
      @BlizStudio  2 года назад

      Hey H.K, you need to make sure in the Add Force 2D action, you set the type of force to "Impulse". This will make your character jump.

    • @CodexCornerGames
      @CodexCornerGames 2 года назад

      @@BlizStudio Thanks, I realised what the problem was, my character script was interfering with the jump FSM. When I disabled it as a child of the jump object, it worked. Is there any way to separate it so it works when enabled?

    • @BlizStudio
      @BlizStudio  2 года назад

      Yep, in my example, I have the player movement as one FSM, and then Jump as a second FSM, and I have climb as another FSM all separate FSMs controlling the player.

    • @CodexCornerGames
      @CodexCornerGames 2 года назад

      @@BlizStudio Thanks, this worked! Also, I tried to play an animation with the 'Play Animation' action but it doesn't work. I am using a C# script for movement and animations. How do I fix this?

  • @cyberwolf1198
    @cyberwolf1198 3 года назад +2

    hey !! i have done every thing the way u did but the character is not getting the jump force applied. the rest is fine. what do i do???

    • @BlizStudio
      @BlizStudio  3 года назад

      Hey Quran, do you have a rigid body component on your character? Also, in the playmaker Add Force 2D action, do you have "Impulse" as the force type selected?

    • @cyberwolf1198
      @cyberwolf1198 3 года назад +1

      yes

    • @cyberwolf1198
      @cyberwolf1198 3 года назад +1

      @@BlizStudio is there a way to send u the screen shots of my fsm , rigid body and colliders of my player?

    • @BlizStudio
      @BlizStudio  3 года назад

      @@cyberwolf1198 Best would to join my discord and you post screen shots there. discord.gg/5zvqccN3

    • @milkhouseworkshop
      @milkhouseworkshop 3 года назад

      @@BlizStudio I also had this issue

  • @EmilieGeibel
    @EmilieGeibel 2 года назад +1

    Hey! I followed your previous tutorial on player movement and flipping which worked great, but when I tried this tutorial to get my character to jump he just stands there and it doesn't work. I turned off the player movement and the jump seemed to work fine so I believe the issue is in the player movement and won't allow the jump to work but I can't figure out what it is! Lol

    • @BlizStudio
      @BlizStudio  2 года назад +1

      Hey Emilie, make sure in your player Move FSM that you have in your Set Velocity 2D to NOT set the Vector line. That should have "none". Only set the X value. If you have the Vector set which is both X and Y the Y will be competing with your jump.

  • @joppetto86
    @joppetto86 2 года назад +1

    Hey Jerry, when I initially jump, the raycast appears to be checking the ground straight away, and so I can still double jump. Should I put a delay or something after I jump?

    • @BlizStudio
      @BlizStudio  2 года назад

      Hey Jon O, one make sure you aren't checking your terrain until after you make the jump. So a state to listen for key press. The next state would make the character jump (add force 2D), then it would go to a state that is checking if the player hits the ground with the Raycast. A couple things to check on your Raycast. One, is make sure you have the Raycast just as long as you need it to be to reach the bottom of your character.
      Another way to also accomplish the same thing will be with using a Collider 2D event. You'll want to add anything the player can jump on to that specific layer, has a collider, etc... Then if the player Collides with one of the game objects on that layer then it will allow another jump. (I think Raycast works better though.)

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

    Im only in jump input and it wont jump

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

      Hey @immersiveBlue make sure that in your move FSM that you DON'T have the to XY in your translate set as well as the individual X. That XY is by default set to 0. This is what usually prevents a jump. So just uncheck the variable option there so that it says None. But you will have just the individual X set down below in the action.

  • @KiranKumar-yj4zx
    @KiranKumar-yj4zx 3 года назад +1

    Can you create course beginners to advanced playmaker

    • @BlizStudio
      @BlizStudio  3 года назад

      Hey Kiran, what kind of games? I've started an outline of a full course. Not sure where I will host it yet.

  • @cyberwolf1198
    @cyberwolf1198 3 года назад +1

    after you told me to make the vector to none , my player was jumping. But now my player is jumping twice instead of 1 time
    what should i do?

    • @BlizStudio
      @BlizStudio  3 года назад

      Just make sure you have your Ground Check in your loop and that the Raycast in the Ground Check state isn't too tall.

    • @cyberwolf1198
      @cyberwolf1198 3 года назад

      @@BlizStudio still not working

  • @jessetobrien
    @jessetobrien 2 года назад +1

    Hi Jerry, it's probably pretty simple but how would you add a land animation that transitions back into the idle state? Can't find much on RUclips for this, at least not with Playmaker. Thanks for making such accessible tutorials!

    • @BlizStudio
      @BlizStudio  2 года назад

      Hey Jesse, Just add another playmaker state right after the grounded state that plays the landing animation (which would probably be a short animation). In that state, play the animation and also a short wait. That should work well. You probably don't want the player to move during that landing animation either (if it's like a super hero kind of dramatic landing) so you would want to disable player movement during that time then re-enable once the animation is done.

    • @jessetobrien
      @jessetobrien 2 года назад +1

      @@BlizStudio great! thanks for the fast reply! And if the player movement is in another FSM or another script, what's the best way to disable it from within the jump FSM landing state?

    • @BlizStudio
      @BlizStudio  2 года назад

      You can do it a couple ways. Easiest would be to just deactivate the Movement FSM and then re-enable it. Or you could have a empty state in the movement state that has nothing in it and that state have a Global Transition on it. You can then use the Send Event by Name to place movement in that state, and then when done use another Global Transition to go back to your idle movement.

    • @BlizStudio
      @BlizStudio  2 года назад

      also... good questions!!

  • @kizz06
    @kizz06 2 года назад +2

    very helpful, thanks!

  • @The_Bunny_King
    @The_Bunny_King 2 года назад

    I have an interesting question.
    I can move, and I can Jump... but I can't jump while moving. I can see all the States turn green in order on my jump, but he wont leave the ground if moving.
    Do you have any Ideas what I could be doing wrong?

    • @BlizStudio
      @BlizStudio  2 года назад

      Hey Brandon, do you have your jump actions inside of the Move FSM? If so it can only be in one state at a time. Jump, I make as a separate FSM and you'll still be able to move and jump at the same time.

  • @bonefiregames3994
    @bonefiregames3994 2 года назад

    I've got it working! However, if the character falls from any height it doesnt get passed the ground check again. And then sometimes it will do the ground check properly but then it'll let my character double jump. Any idea what could cause that?

    • @BlizStudio
      @BlizStudio  2 года назад +1

      Part of it could be speed and the collision itself. In the Player's rigid body component, make sure the Collision type is set to Continuous or Continuous Dynamic. It's discrete by default. Again speed is a factor, how often you are checking recast if you are doing recast, and timing.

    • @bonefiregames3994
      @bonefiregames3994 2 года назад

      @@BlizStudio hey thanks for the reply! With the video being almost a year old i wasnt too optimistic 😅. I checked it out and the players rigid body is set to continuous and my raycast has the same settings as you. Could it possible have to do with the players box collider?

  • @dont_know3036
    @dont_know3036 2 года назад

    My jump works if I don't have a transition, but If I add one it'll go through (I can see it activating), but nothing happens

    • @BlizStudio
      @BlizStudio  2 года назад

      Hey Jo'siri, in your Add Force action, are you applying a force type of "Impulse"? This pushes that force all in one kind of explosive force vs a little at a time.

    • @dont_know3036
      @dont_know3036 2 года назад

      yeah

    • @BlizStudio
      @BlizStudio  2 года назад

      And you have a rigid body to your player?

    • @dont_know3036
      @dont_know3036 2 года назад

      @@BlizStudio yeah I made a new file and increased everything by 10, and it works know.
      Also using playmaker how would I make something that can only move when you look away?

    • @BlizStudio
      @BlizStudio  2 года назад

      Oh dang. That's an interesting question. Maybe let me know a scenario to better understand. So like a ninja enemy only moves when the player isn't looking? If something like that, then you can have a collider on the player that is set up in front of the player as a field of view that is a Trigger . Then on the ninja character, it detects if the on trigger stay (vs trigger enter) then the ninja freezes. If it does trigger exit, then it can move again.

  • @hudiyaichwana6312
    @hudiyaichwana6312 2 года назад

    Why my character wont jump

    • @BlizStudio
      @BlizStudio  2 года назад

      Hey Hudiya, pop over to my discord discord.gg/DgUdNDT7KU and you can explain what might be going wrong and how we can help fix.

  • @cyberwolf1198
    @cyberwolf1198 3 года назад

    can u send me a discord invite?