Wall Jump in Unity - 2D Character Controller

Ойындар

In this UNITY tutorial we are going through one of the most used abilities in videogames, the WALL JUMP ability. We are going to divide it into different parts to better comprehend how it works.
________________RESOURCES_________________
GITHUB: github.com/Shinjingi/Unity2D-...
_______________________________________________
__________________SOCIALS__________________
INSTAGRAM: / shinjingi_
TWITTER: / shinjingi_
DISCORD: / discord
_______________________________________________

Пікірлер: 49

  • @Shinjingi
    @Shinjingi Жыл бұрын

    For this video i was inspired by Sebastian Lague, a few years ago he made a character controller where he used the approach shown in this video to make a wall jump that suits different needs based on player input. I found it clever and most of all useful to have the same kind of ability for this controller, so I adapted it and made it work. Hope this can help you in your projects!

  • @Snapslol
    @Snapslol Жыл бұрын

    Great tutorial again, not everything is exactly the way I wanted it but the code is so readable that it's not too much of a challenge to change a few things, add some messy if statements and get it tuned exactly the way I was looking for. Thanks!

  • @Exynthie
    @Exynthie Жыл бұрын

    Thank you for making these videos! Great and informative.

  • @lakesidewiseman
    @lakesidewiseman Жыл бұрын

    Can't wait for the next AI tutorial. I had done your 2021 video and modified to to add a higher jump myself and had organized a way to do wall jumps in my head, I had no idea you had made this new video.

  • @irishmalteser296
    @irishmalteser296 Жыл бұрын

    This tutorial series was so help full thank you! One question, how would you go about making a dash? (like in hollow knight for example)

  • @atTran-fb4wt
    @atTran-fb4wt Жыл бұрын

    Great tutorial !!! Can you do something about player attack ? I really need that. Thank you so much.

  • @user-ct1do2ik2s
    @user-ct1do2ik2s Жыл бұрын

    TY, cool!

  • @creadoc
    @creadoc Жыл бұрын

    This is an awesome tutorial and great work! I do have one question though: I the player wall leaps and holds the jump button and the left or right movement button that is opposite of the wall they leaped off of, my player never lands until they let off of the buttons. Any ideas?

  • @Kavee_3
    @Kavee_3 Жыл бұрын

    This is awesome, Thank you so much for this. By the way, can you tell me what visual studio extension you use to get that code suggestions

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    Hi, i just updated visual studio i didn't install anything

  • @Kavee_3

    @Kavee_3

    Жыл бұрын

    @@Shinjingi Thank you, I should update it too

  • @ushanka2855
    @ushanka2855 Жыл бұрын

    Hello! Thanks for making these tutorials. It looks like an extremely modular and effective way to create character controllers. I think it's also super clever to make the controllers as scriptable objects allowing for various inputs. But with that comes my question: how would you deal with putting AI logic in a scriptable object and how to intagrate unity gameobject (an enemy for example) with the input script? It seems like calculating a good moment to jump or to move is always based on current position, hight, AI state et cetera, and AI controllers would need to be fed with mentioned data. I firstly thought of giving arguments to RetrieveInput functions (like Vector3 if position is needed), but it seems uneffective and makes it less modular (since player controller doesn't need this data at all). I hope that my question is clear and thanks again for making a great tutorial series! Cheers!

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    Hi, I'm going to cover AI examples in a couple of videos, probably after the next one since i want to move into different things.

  • @ushanka2855

    @ushanka2855

    Жыл бұрын

    ​@@Shinjingi Great! Thanks for your anwser. Could you just give me a hint how to setup such system? The crucial question here is: how would you pass data to scriptable object from a mono behavior? I based a game on this system and even a one world hint would be a great help (so I could just google the solution for example). Looking forward for the next video and your anwser :)

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    @@ushanka2855 Behaviors are written in the controllers (for each of the input you write logic on how to generate those inputs).

  • @ushanka2855

    @ushanka2855

    Жыл бұрын

    @@Shinjingi yeah I figured that, but controllers don't have any access to objects they are on, since they are not MonoBehaviours (meaning you can't attach them to GameObjects). The AI logic most of the time is based on values like current enemy's position, but there is no access to that from controller level. Or maybe I got something wrong? Edit: Maybe a simple solution would be to change controller inharitance from ScriptableObject to MonoBahaviour, since there is no need to create multiple instances of controller types and it would grand mentioned access to GameObject's values (like transform). I will probably test it out, but wanted to know what are your thoughts on that approach?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    @@ushanka2855 The only thing i can tell you now is that I'm going to cover this in the next video, please try to solve the issue yourself or wait for it.

  • @omerkara6517
    @omerkara6517 Жыл бұрын

    Do you plan adding corner correction and edge catching for more juicy controls.

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    I don't think so... This series was meant to show how to design a modular character controller for both the player and the enemies.

  • @insomnolentstudios
    @insomnolentstudios Жыл бұрын

    How do you add animations?

  • @crowbar6723
    @crowbar6723 Жыл бұрын

    So ive found this to be the absolute best character controller yet, only issue ive had is using tilemap colliders. Using Box Collider 2d works perfectly, but when i apply a Tilemap collider, it seems to catch on the ground or while running it will stutter and play my falling animation for a frame. I then added a composite collider and set the tile map to "Use by composite" and it fixes the animation stutter, but it makes jumping while moving no longer function, to jump you have to stop completely. Ive checked common solutions online, like making sure the player and tile map are on the same layer, and even trying the jump controls in update instead of fixedupdate. Nothing helped and I'm at a stand still, and individually placing box colliders for each platform is possible, but would be a nightmare, any fix for this issue?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    This issue can be solved by changing the script that retrieves ground data to use raycasts instead of the actual method of detection. You only need to change that class, this is the advantage of having a modular approach.

  • @TheWavve
    @TheWavve Жыл бұрын

    great update to the controller. Any tips on how to convert to New Input System?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    If all goes well i should upload a new video next week, after that I will cover how to transition to the new Input System in the next and last episode of the series.

  • @TheWavve

    @TheWavve

    Жыл бұрын

    @@Shinjingi Legend! looking forward to your next videos.

  • @pablocruz8151
    @pablocruz8151 Жыл бұрын

    Hi, thank you for a great controller! I am making my (non-commercial) game with it. How would I go about it if I wanted for the character to walk on slopes? Could you please help me? Any guidance or advice will be very appreciated!

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    I suggest you to look at CatLikeCoding website, in the Movement section you will find your answer. Be aware that it's applied to 3D so you should convert it to 2D. Good luck with it!

  • @pablocruz8151

    @pablocruz8151

    Жыл бұрын

    @@Shinjingi Thank you! I very much appreciate it. I'll give you credit in my game when it's finished!

  • @greencatarts
    @greencatarts Жыл бұрын

    Absolutely love this, but there is a problem in assets/scripts/check/collisiondataretriever on line 45 unity gives me the error saying that object reference is not set to instance of an object, how do you fix this and is it even needed?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    Please download the full project on Github and compare the two.

  • @greencatarts

    @greencatarts

    Жыл бұрын

    @@Shinjingi I already have i still get the same issue :/

  • @Tom-ll5qw

    @Tom-ll5qw

    Жыл бұрын

    @@greencatarts whats on line 45 of your collision data retriever script? it might just be a variable you forgot to set in the inspector

  • @yeski9925
    @yeski99254 ай бұрын

    my charachter can't slide down the walls or jump from them. Did you use a tag that you put on the walls so the script knows you're on a wall?

  • @alfiehine2931
    @alfiehine2931 Жыл бұрын

    I was using this and wanted to use the new input system, how would i convert the player controller script to the new input system?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    I will cover it in the last video of the series, finished recording the one for the AI behavior just now, it will be up in 1-2 weeks. P.S. The last episode will be the one after the AI behavior.

  • @elojys

    @elojys

    Жыл бұрын

    @@Shinjingi Yo, are you still working on the videos? Great tutorials.

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    @@elojys Yes, i'll release the next one in a few weeks

  • @thanhcongthi3008
    @thanhcongthi300811 ай бұрын

    How to flip my character when wall bouncing. I tried but after I flip my character the animation is reversed. Please help

  • @matodeus9179
    @matodeus9179 Жыл бұрын

    I can't jump while moving is that normal if not then how do i solve it?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    Download the project from Github and compare it with yours. Be sure to select the appropriate branch when downloading it.

  • @noyokay
    @noyokay Жыл бұрын

    How can I make it feel more responsive?

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    Just play with the Controller settings, adjusting acceleration should do the trick

  • @papisedits5801
    @papisedits5801 Жыл бұрын

    How could I remove the inertia from the character

  • @Shinjingi

    @Shinjingi

    Жыл бұрын

    Adjust acceleration

  • @papisedits5801

    @papisedits5801

    Жыл бұрын

    @@Shinjingi it worked thanks

Келесі