The ULTIMATE 2D Character CONTROLLER in UNITY

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

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

  • @GMTK
    @GMTK 2 года назад +154

    Hey! This is a cool controller - got it feeling nice. Wondered if you had any advice on handling moving platforms? The frictionless physics material makes it so the character doesn't move with a moving Rigibody (I've tested using DOTween on a Rigidbody2D and the character doesn't move with it). Any ideas would be great!

    • @Shinjingi
      @Shinjingi  2 года назад +23

      Hi, nice to see you here! My solution would be to keep track of the connected body the one that is in direct contact with the sphere. You can do that by retrieving the object's Rigidbody2D the sphere is in contact with. Next to determine the motion just subtract the position the connected object is currently at with its previous one, that will give you the connected object's movement that needs to be divided by the deltaTime to get the actual speed. Once you have the speed of the connected object just subtract that to the velocity of the sphere to have the relative velocity. I skipped a lot of steps because i just wanted to give you an idea on how to solve this issue, hope this will help you!

    • @GMTK
      @GMTK 2 года назад +8

      @@Shinjingi Thanks for the reply! I will… try and implement this!

    • @Shinjingi
      @Shinjingi  2 года назад +12

      ​@@GMTK If you don't seem to find a proper way to implement it or the solution i described has some flaw, i can provide another tutorial that covers it, sometime next week if you are not in a hurry...

    • @GMTK
      @GMTK 2 года назад +14

      @@Shinjingi That’d be awesome - I’m a bit out of my depth with this! You will, of course, get full credit in the game and videos :)

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

      Exactly my problem since I tried rigidbody player movement, it seems almost impossible to solve moving problem so I guess I will rewrite my character controller to use transform.translate and use raycasts etc. this way it’s easy to implement moving platforms. …. I wasted over a week with rigidbodies and couldn’t find a solution. There are tons of problems to figure out that you don’t think at first, what if you block the moving platform from moving with the player? What if you stand on the edge of the platform and the platform goes next to a wall to prevent glitching through the wall?

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

    I truly admire the cleanliness of how this code is laid out and how so many components are built to be used by a variety of entities. Well done, and thank you!

  • @Shinjingi
    @Shinjingi  3 года назад +35

    This is the longest video I've done so far, what a challenge! But i wanted to share this video with all of you, because this is one of the pillars of 2D Games, Character Movement may sometimes be overlooked or given for granted, but it is an essential part of the game. So with this tutorial i wanted to give you some tips on how to create a scalable and multi purpose controller not only for the Player but for all the characters in your game!

  • @Dragonaud
    @Dragonaud 3 месяца назад +2

    Thank you for this quality tutorial with clean and reusable code. I just started exploring gamedev (I have background in web/apps). There is plenty of tutorials about Unity and C#, but rarely someone spends time organizing code and making it resuable. Thats one of basic truths of programming: "less code is always more".

  • @leodelacruz5521
    @leodelacruz5521 3 года назад +11

    I like how you explained the reasoning behind how you did certain things. A lot of videos just say to 'do this' without any further explanation, and it leaves me little idea on how I can further expand on a mechanic. Keep up the good work!

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

      Thank you i appreciate it!

  • @Foxtrot6624
    @Foxtrot6624 2 года назад +5

    Mate it is an absolute disgrace that this only has 3000 views. Phenomenal quality content, and belongs alongside brackeys etc. Clear, concise and actually useful, unlike the majority of nonsense in the pages and pages of content I had to shift through to find this gem.

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

      it's about to get more after getting namedropped and linked in today's gmtk video. i'm here from there and am about to port this controller to godot.

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

      @@slipperynickels completely deserved shout out, this is one of the strongest skeleton controllers out there imo. Good luck with whatever you're working on in godot :)

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

    Now this is a master platform movement controller. Adjust here and there for your own prefs and it is just amazing, made my game more interactive and fun.

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

    Amazing. I‘ve seen dozens of such videos, but this is looks like the best. Very good care for more advanced, but important things. I recommend to begin, and tease with a few seconds showing off the result, so viewers get enticed. And after that, give a brief overview of which parts or scripts are being made and why. Excellent work, thank you!

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

      I totally agree on showing how the different scripts work together in a kind of diagram expecially on wide systems like this one. The only reason i didn't show the ending result at the beginning is that i felt that showing a cube moving wasn't that interesting... But I'll try to make up for that next time, thank you for your kind words!

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

    Intresting controller setup with good architectural structure. I ve seen a lot of ways this can be done but this is quite unique setup. I m gonna give it a try.
    Edit: Man this works very well as it is very easy to configure the movement. I am so glad i watched this trough as i had already created another controller for my prototype. I managed to convert this into 3D as i am working on a 2.5D style game and i m now into the proccess of adding Jump Buffer, Coyote Time and Jump Corner Correction so i dont get stuck under platforms when jumping, but this was an amazing base for the controller and beleive me i ve watched / read a lot of ways to do things. The structure and configurability of this is awesome! Thank you very much for this and keep up the good work!

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

      Thank you, wish you the best with your project!

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

    So why exactly did you make the InputController a scriptableObject (instead of like a static class or none at all) ? Does not make much sense in a vacume

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

    I've got the error "The type or namespace name 'Controller' could not be found", any way to fix this or is this because of the new input system?

  • @Twitchingeagle
    @Twitchingeagle 2 года назад +7

    I came here from GMTK because he praised your character controller and I have to agree, I like it very much. I was hoping, as someone who wants to do well in this professionally someday, what process brought you to being able to design this? How did you get as good as you have at developing character movement?

    • @Shinjingi
      @Shinjingi  2 года назад +16

      First i want to thank you for your kind words, this is a dear question to me since i remember asking the same thing to a RUclipsr around 2017, so having it asked back at me feels quite strange and i feel a responsibility in answering as best as i can.
      Of course i didn't become accustomed to Unity's workflow by the night, it did require 1.5/2 years of developing games almost every day, since that was what i wanted to do i focused 100% on that, and after watching and reading a lot of material about Unity, i just didn't require to lookup things up anymore.
      But even after that, i still didn't know how to properly organize the work, design systems that were scalable and did work well together. So i started focusing my attention on actual game design videos, books, and any other type of resource. Luckily I'm a fan of well written code so this was one of my favorite parts, but for other people it may be boring to the point where you neglect doing this part properly. And i want to specify that this is the MOST IMPORTANT part in programming, especially if you are interested in pursuing this career. A lot of the things that you will learn from a design perspective can be used even in other fields so i can't stress enough the importance of designing good systems before hand, i usually use Flowcharts to do so and it helps me quite a lot in visualizing how things work and interact with one another.
      Lastly, as bad as it could sound this is the one that carries out pretty much any field in any industry, to steal from others and improve upon that. Remember I'm saying stealing not copying, as Pablo Picasso said “Bad artists copy, great artists steal”. This will help you have a good reference for a starting point and then you can study ways to improve them or to change them so that they suit your needs. This overtime will improve your overall understanding of code, if you can do the same even when following tutorials or any kind of material on the subject, try giving it your own twist so that you don't just copy it. A way of doing this is to decide to make a small project, very small and with zero knowledge on the subject step by step look what you actually need for that project to be done. This will make so that you will encounter problems that you will have to solve in your own way.
      To summarize things up:
      -(Learn) Get used to the technology that you want to use, whatever it is, it will be the most time consuming part.
      -(Design) After you are accustomed to it, improve how you make things, now you have the knowledge so you can refine things up.
      -(Steal) To have a good starting point for your projects, look at those who have succeeded and improve upon their work.
      Bonus Point: PERSEVERE if this is the career that you want to pursue, give it your all!
      If you want to know more, about which resources i did use or i suggest following, please consider joining my Discord, is free, quiet and discrete, I don't write very often but i do answer questions every time.

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

      @@Shinjingi Thank you very much for the reply, I really did learn a lot from your code. Your method of ground checking was a great use of one of the design patterns (name escapes me) and it was very instructive in using multiple scripts instead of having one bloated script. With that said, I may see how to make your input controller work with addforce instead of velocity!

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

      Having the same question for you and since you already answered it, I have to tank you for taking your time to write such a great response, since it not only attended the person that made the question but all of us newbies exited to learn game dev having the same doubts! I don’t know if your Discord still on but I’ll try to join right away! Cheers and thanks for the excellent content!

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

    This is the only one that actually worked it was worth the headache xD

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

    Super Impressive but I am waaaaaay too slow to keep up with that speed of your typing and shortcut use.

  • @jozimastar95
    @jozimastar95 2 года назад +4

    i tryed it and get a lot of errors but even if i can fix some i still get this one (NullReferenceException: Object reference not set to an instance of an object
    ground.retrivefiction (UnityEngine.Collision2D collision) (at Assets)
    or thr player keep floating

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

      That is because you don't have a rigidbody2D component attached to the ground onject.
      Add a rigidbosy component to the ground, set it to static and give it a physics material
      (I just saw the comment was 4 months old 😶)

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

      @@meshhra Well, I was having the same problem so very glad you commented this 😁

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

    I followed the instructions perfectly, but when it comes time to add the move script to the character, it doesn't let me because "the script class cannot be found."
    It also has given me an error stating that the Ground script "cannot implicitly convert type 'UnityEngine.Rigidbody2D' to 'UnityEngine.PhysicsMaterial2D' and I have no idea how to fix it

    • @mertk.9136
      @mertk.9136 Год назад +1

      It means you have a typo. You can fix this by making both this line in your move Script:
      public class *this one **->-*- Ground -*-

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

    Good job, awesome script. You should do a video where you attach the player sprites to the scripts you just made, that would be a great help for a lot of people. Thanks

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

      Another great idea would be to add some other scripts like slide, various attacks or skills, wallslide. Because you are great at making this scripts and I found 0 scripts on youtube that are clear like yours. Great job again

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

    Hey! It's a nice controller and a well explained video, what more? You got a new sub. Thanks! It's the controller I was looking for.

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

    Gotta say, I keep coming back to this video. This deserves way more attention than it's getting. Excellent work!
    The one thing I noticed is that tweaking the upwardMovementMultiplier variable changes the height of the player's jump. It looks like your jumpHeight calculation doesn't consider that upward multiplier.
    To fix:
    float jumpSpeed = Mathf.Sqrt(-2f * Physics2D.gravity.y * jumpHeight);
    ...should become...
    float jumpSpeed = Mathf.Sqrt(-2f * Physics2D.gravity.y * jumpHeight * upwardMovementMultiplier);
    This change allows you to tweak the upwardMovementMultiplier without affecting jump height, and ensures that your character will jump the specified height in meters every time.

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

      Splendind suggestion! Thanks for your words, a new video is coming soon. I'll try to remember to put this fix on it!

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

    Really great tutorial. A game I'm working on actually uses similar methods and due to this I wanted to ask if you found any good way to add slope handling? Most of the tutorials are designed around setting a velocity unlike this method which uses acceleration. Any information would be really helpful. Thank you.

  • @sanaytyagi1125
    @sanaytyagi1125 2 года назад +5

    Hello! This is an amazing platformer controller, and I really love the method you used to get the movement to feel fluid and the jumping to feel firm and satisfying! I used this tutorial in making my project, and I came across an issue, and I was wondering if you or anyone else in the comments could help. When I try to double jump, if i do it immediately after the first jump, it is a good height, but if I start to fall down a little before jumping again, the jump barely makes the player go up. I am assuming that this is because of the downward force that is applied to the player at the fall of the jump, but i do not know how to fix it. Thank you!

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

      Hello there, I’m not sure of you’ve already found a solution to this, but I wanted to explain mine. I removed the if(desiredJump) statement made at 13:20 and copied it into each of the if(body.velocity.y) statements made at 13:29, 13:38 and 13:43. However for the if(body.velocity.y < 0) I added velocity.y = 0 in the if(desiredJump) copied earlier. If anyone found a better solution please let me know.

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

      @@kingblob3386 Just type if(body.velocity.y < 0) velocity.y = 0; into the if(desiredJump) statement before JumpAction();

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

      Just wanted to add my own solution for others. I made velocity.y = jumpSpeed at the end of JumpAction(), rather than using +=. Then remove the if(velocity.y > 0f) statement before it, because we don't care what our vertical velocity was if we want the jump to act the same way each time

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

      @@cosmickly Great solution, thanks!

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

    Nice video, but my AIController isnt appearing when try to create it through input controller for the ScriptibleObjects folder, any help? 5:20

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

    You're an amazing guide with a useful script structure that I would like to take guidance from for my first game. However, I'm brand new to game dev, working on a solo project in my free time, coming from an art background. I followed your guide but can't seem to figure out how to implement animating my sprites with this player controller. I've tried several things including making an animation manager script but I'm such a beginner I can't wrap my head around everything involved. Any advice on how to move forward with my animations?

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

      Hi, if you are just starting out i would recommend to follow CodeMonkey 10 hours long video, it will get you started in the right way. This series is meant to give a different approach on how to develop a character controller that works both for the player and the enemies.

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

    Hey great controller, can you make a tutorial to add jump buffer and hold jump button to jump higher because I have some problems when I try to make them, and thank you for your tutorial❤️

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

      I'll do another video that adds more functionalities to it, it will require some time but you can expect one in the near future.

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

      @@Shinjingi Thank you very much ❤️, I will wait for it

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

    This was a really good video, it really helped me with what I wanted to do, and I hope you will continue doing tutorials for other Capabilities(like attacking and shooting etc.) !

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

    2 questions how can i make variable jump height, and how can i make it no acceleration or anything like that

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

    Good video! I just wonder if it's possible to deal with slopes given this approach.

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

    The best 2d Character CONTROLLER for UNITY, thank you !!!!!

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

    I was doing great for most of the video but this |= operator is confusing me. Can anyone point me toward some information on how I can understand how this is being used? From what I saw online it looked like a bitwise or assignment operation that I know from javascript - is this correct? Amazing video by the way I am so excited to work through this 2D controller series!!

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

      Thank you! Someone already asked this question in the comments below. You can check that!

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

    Hello! Thank you for this great video, I am trying to follow along and have hit a snag. I noticed that in the jump script there is a new line called "private Controller controller;" but unity tells me that Controller is not valid. I am trying to see between this video and the improved jump video where this controller gets implemented and what it could be, is it called something else now?

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

    for some reason, it detects it as grounded when i touch a wall

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

    Hi. I want to make a game in which I want that enemy jump toward me when my Player reaches a specific point. Please help me

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

    Will you make more Tutorials in the future? Because you make great content!

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

      Thank you! Yes, I'm just waiting for the right time since I recently got a new job.

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

    i have followed step by step and have no errors in any of the codes but i cant move my character

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

    Hi, any sugestion for make this controller work for movile 2d joystick ?, Great video

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

    I'm noticing a problem with the screen resolutions.
    if i set the jump to 100. and the resolution is at 1920x1080.... its barel ya hop.
    but if i set the screen resolution to 1280x720 the character is simply launched out of the screen.
    i think this has to do with how units and pixels are determined.
    any ideas?

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

    What is the theme you are using in Visuasl Studio in this video? It's really good.

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

      Just the Dark one, no changes done.

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

      @@Shinjingi "public class" and "void Start" are pink. But they are not in normal Dark theme. It looks beutiful. But if you don't know It's okay :)

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

    Does anyone know why I didn't get the red squiggly line and the implement option like in 4:08?

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

    Amazing tutorial. I’m just doubting the ground check part because it doesnt work on slopes and i was wandering if it wouldnt be easier to check if the game object had a certain tag or layer? If theres a better solution could you make a tutorial on that?

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

      To both, the answer is yes. I'm going to release another video in 2 weeks which covers converting the controller to the new input system. After that i will cover the ground issue.

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

      @@Shinjingi thank you!

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

    hi im running into problems with the Move Script its saying that the name Controller couldnt be found. any ideas thanks in advance

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

      Hi, i suggest to download the project from Github and have a look at what's different on your project, this is the fastest way to solve your issue.

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

    Nothing here is working on my visual studio or unity, first 4 minutes in and its not letting me implement abstract class, 1 minute later, I cant find any of the assets that I supposedly created.
    and I have tried everything but it hasnt worked. I've even deleted and reinstalled unity and visual studio but nothing has worked. nothing I've found online has helped. and I have yet to find a video where it explains how to import a player controller from other files. i really need help here.

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

      Download the project from GitHub, link in the description

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

    for some reason the my player is not jumping. Can anyone help me find what is wrong about this?

  • @kanavscreativeworld9722
    @kanavscreativeworld9722 5 месяцев назад +1

    Would it be possible to use this for commercial purposes without credits?

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

    Damn I wish this was less complicated. All this abstract asset menu input controller I don't know what any of that is

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

    I love this tutorial and the concept of it but I am stuck. In visual studio I have an error (red squiggly line) under return if; in the AIController. I also have issues at timestamp 9:48 when you are adding move and ground scripts to the character. I get the error message can't add script component 'Move' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match. I get a duplicate message like this for the ground script. The only compile error I am finding is in the AIController as mentioned above. Any idea what I am doing wrong?

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

      Download the full project in the description, the one for this episode and compare the code with yours. That's the best way to get rid of errors

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

      @@Shinjingi Thank you! I found the error. I had a typo. You had 1f for the return value not if. My bad.

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

    for some reason i cant use the implement abstract class, Im guessing that something went wrong because my screen didn't have the squiggly line under player controller 4:06

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

    How could I make this code flip on the x axis when turning and have animation when moving

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

      Supposing your sprites are all oriented to the right, set the local scale X to 1 when going right and -1 when going left, this will flip your sprites in the direction you are facing

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

      @@Shinjingi but how would I change a variable when going specifically to the left

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

    at 5:07, the "input controller" selection on your menu doesn't show up for me

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

      check if the names are right. happens to me a lot

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

    it work in any unity editor

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

    Has anyone figured out how to implement this using the new Input System?

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

      thats what Im tring to figure out. I dont think hes responding to comments anymore :(

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

      @@Ddotkay Well, our prayers have been answered. He released a video on the new input system 2 months ago! 😅

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

    Love the content, and maybe this is too advanced of a character controller for me, but how would you control character animations through this system? Is it better to completely leave it alone and use triggers or bools rather than the horizontal float method?

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

      If the project i work on is in 2D then I just use a state machine that actually plays the animation the state is in (Idle, Walking, Jumping...) This makes sure that both the action in the code and the one in the animator act at the same time. If the project is in 3D and i need all the blending features that the animator offers, I do a similar thing but instead of playing the animation directly, I do that by setting parameters and the conditions will take care of playing the appropriate animation.

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

      @@Shinjingi ok rad, makes sense. How well so would this handle slopes? I’m using a basic rigidbody2d.addforce for movement but when I reach the top of stairs, the momentum continues forward and it flies off.

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

    awesome!

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

    Did everything exactly the same but jumping doesn't work. My character just floats to the ground. Need help

    • @jeff-ii6gc
      @jeff-ii6gc 2 года назад

      check the input jump in the project settings, maybe that's it

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

    This is an amazing character controller! One question though, depending on when i press jump the character will have a bigger or smaller second jump. is there a way to make it so its always the same jump?

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

      It should be solved in later videos of the series, basically what is happening is the following: If you are going down let's say at a speed of -3f and the jumpSpeed it's 6f the currentSpeed+jumpSpeed=3f instead of the 6f it should be. So to solve this issue you need to make sure that even when going down you set the speed of the jump to the proper value. This can be achieved in different ways, I'll leave that part to you

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

      @@Shinjingi Oh i didnt know this was a video series. Thank you for the help!

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

      @@irishmalteser296 It's only a series if you want to, if not take what you need and improve on it, good luck!

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

      @@Shinjingi Will do. Thank you for the help!

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

    Im unable to jump I dono why I completely followed the tutraial

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

    i loved this video

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

    Thank you for this amazing controller. I had my own but this is much more advanced than mine. One thing is bothering me though. I cannot resolve an issue when I am close to a vertical wall in tilemap and I want to jump. It thinks that I am touching ground even after the first jump. This is happening only for tilemap and for box collider it works well. On tilemap I am using tilemap collider together with composite collider. Any advice on that? Thanks in advance

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

    Thanks for the nice video,. help me a lot understanding more and smart ways to setup. i just have 1 problem. the player doesn't seem to get in touch with the ground. i can jump the max air jump and that is it. but if i touch the sides and the bottom of the ground, the jumps gets reset. and still if i rotate the ground or the player. is still happens the same way.. any ide ?

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

      Thank you Glenn. If you have a problem with the collision detection it has to be something with the Box or Edge collider bot being properly set up. You can check it in the appropriate script in the OnCollisionEnter2D() and OnCollisionStay2D() methods. If you don' t seem to find a solution for it, i suggest to download the project available on Github, link in the description.

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

    This looks really good! I did have a quick question though. In the move script, you use Time.deltaTime for calculating maxSpeedChange, but this calculation is done in fixedUpdate. Shouldn't you use Time.fixedDeltaTime instead to avoid issues with frame rate dependency?

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

      Time.deltaTime gets automatically converted to fixedDeltaTime when used in FixedUpdate.

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

      @@Shinjingi Interesting, I didn't know that! Thanks!

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

    Does this still work with the 2022 editors?

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

      I don't know I'm still using the latest LTS

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

    Unity is so good

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

    would this work for a 2.5d game

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

      If you mean something like Octopath Traveler the answer is no.

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

      @@Shinjingi I meant something like donkey kong country tropical freeze.

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

      @@xxfantomxx6 Yes that would work, the game is constrained in 2 axis (X,Y). So doesn't matter if models are 3D.

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

      @@Shinjingi thank you

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

    hmm just couldn't get the jump to feel smooth :/

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

      Read whutsurnaymPersonal comment below, it's a required change I will discuss in the upcoming video

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

    I'm probably the biggest Noob in here and It's making me feel disheartened as I'd love to make my own game :(
    Not even a minute in and I'm stuck. I created a material, called it "Trail" then I go to change the colour and for me there is no colour option whatsoever. Apparently it works differently if I am using URP but how is the question. How am I the only one in these comments that cant get past the first minute without getting stuck. Grrr...

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

    i didn't understand shit. I'm just tryna move left and right

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

    Ultimate 2d controller? its like 50 lines? also, physics materials?? yuck, good luck making good controls with that setup

    • @slipperynickels
      @slipperynickels 2 года назад +8

      heya! it's been three months, did you manage to make something out of your way better setup? can i see?

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

    9:15 - shouldn't this be `Time.fixedDeltaTime`?

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

      Time.DeltaTime gets automatically converted to FixedDeltaTime inside FixedUpdate()