2D JUMP IN UNITY IN UNDER 1 MINUTE

Ойындар

#shorts
Enjoy the video, if you have any questions ask in the comments down below!
Request a tutorial here:
forms.gle/JLBkpHt1ZFLpn7TE9
Patreon with fully explained c# scripts:
/ blakeygames
Main Channel: / bblakeyyy
DISCORD SERVER LINK: / discord
unity,unity tutorial,unity 2d tutorial,unity 2d,unity jump,unity 2d jump tutorial,unity 2d jump,unity 2d jump c#,unity jump tutorial,unity 2d smooth jump,unity3d,simple 2d jump in unity,unity tutorial 2d,unity 2d platformer,unity tutorial for beginners,unity 3d,unity game tutorial,2d,how to jump unity,unity short tutorial,how to jump in unity,unity jumping,unity jump code,unity 2d celeste,unity platformer,2d jump in unity Audio used in my videos:
♪ Onion (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Branch (Prod. by Lukrembo)
Link : • (no copyright music) c...
♪ Biscuit (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Bread (Prod. by Lukrembo)
Link : • (no copyright music) j...

Пікірлер: 68

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

    THANK U SO MUCH BRO this helped so much i have been trying to find a decident jump script for days and i find this vid u helped so much keep up the good work

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

    For anyone confused about the variables, basically a float is a number value, it allows decimals. A int doesn't allow decimals into their value. And the difference between private and public is that private only gives the script the information that the variable has and public allows information that the variable has outside the script, making it being configurable outside the script too.

  • @cgillis3989

    @cgillis3989

    5 ай бұрын

    We came to this one minute tutorial to NOT hear all the explanations (Jk, I'm just teasing- it's always a good idea to understand the variables lol. Thank you)

  • @MattQwerty-qw8xv

    @MattQwerty-qw8xv

    Ай бұрын

    ДА НУ НАХУЙ, Я НЕ ЗНАЛ

  • @W5529Fortnite
    @W5529Fortnite10 ай бұрын

    This is a life breaker I just got pure errors one after the other

  • @spikeleon8408
    @spikeleon840811 ай бұрын

    THANK YOU. Your video is short, but very informative, thanks😊

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

    What about the ground check? Currently you’ can just jump forever essentially flight.

  • @kryuza3191

    @kryuza3191

    Жыл бұрын

    just add collision, whenever the player is collsion to the ground its ready to jump but whenever the player is not touching the ground its not ready to jump

  • @gianlucapapa1508

    @gianlucapapa1508

    Жыл бұрын

    ​@@kryuza3191 how can I add it? it's my first time doing it

  • @kryuza3191

    @kryuza3191

    Жыл бұрын

    @@gianlucapapa1508 kzread.info/dash/bejne/laikp9qJaKrHmbQ.html&ab_channel=bblakeyyy

  • @X45Saucr

    @X45Saucr

    Жыл бұрын

    @@gianlucapapa1508 hes not gonna answer it since its 4 months old

  • @JakeSimmer

    @JakeSimmer

    Жыл бұрын

    @@gianlucapapa1508 find other 2dvids bro, 'isjumping' = tru, they put that in the ifstatement. would be cool to keep on jumping tho... Keep on trucking and trying. I only just started and those first steps are soo hard, but allmost there to understand c#... ;-)

  • @cgillis3989
    @cgillis39895 ай бұрын

    Very concise and effective, thank you very much :)

  • @Capsule-tu6mu
    @Capsule-tu6mu10 ай бұрын

    Bro what mine just flyies into the stratosphere

  • @tom_a_tree_is_like_a_bee_w4297
    @tom_a_tree_is_like_a_bee_w429719 күн бұрын

    No fixedupdate for jump collision via layers?

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

    Have a full player movement script available on my Patreon: www.patreon.com/BlakeyGames

  • @namelesskok378
    @namelesskok37811 ай бұрын

    So how do i jump aka how do i do the jump key?

  • @impactsport109
    @impactsport10910 ай бұрын

    Thank you so much ❤

  • @roman_gra_26
    @roman_gra_2610 ай бұрын

    How to do a dash in a topdown game by using the new input system?

  • @Finnersa
    @Finnersa3 ай бұрын

    How can I make it so it won’t fly if you hold it

  • @Nightlock77
    @Nightlock775 ай бұрын

    Why do you prefer default force over impulse?

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

    COOL!

  • @xHavki
    @xHavki11 ай бұрын

    thank you

  • @HerobrineStudio2_YT
    @HerobrineStudio2_YT10 ай бұрын

    Thanks

  • @UnrecordedFootage
    @UnrecordedFootage6 ай бұрын

    It says that I need a jump input can you help me out😅

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

    keep going

  • @avalonsculpture9662
    @avalonsculpture966210 ай бұрын

    how do i bind the jump key to space? it is not binded to any key just "Jump" which is not a key

  • @Isaac096

    @Isaac096

    7 ай бұрын

    Ya idk how to do that

  • @hello.4693

    @hello.4693

    27 күн бұрын

    Old input system: bool isJumping = Input.GetKeyDown(KeyCode.Space); use this in if statement like if(isJumping)

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

    can you have tutorial on how to give the caracter animation with that script

  • @CrayZeeAnimations

    @CrayZeeAnimations

    Жыл бұрын

    Use animation controllers (in the controller use transition arrows, parameters, and conditions)

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

    When I click on the script in unity the float doesn’t appear but I put in the float what’s wrong?

  • @achillejeanvoine8115

    @achillejeanvoine8115

    Жыл бұрын

    Be sure that it is public or SerializedField private

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

    you should add a time.deltatime moltiplication

  • @toontween

    @toontween

    Жыл бұрын

    in this case it would be forcemode.impulse

  • @iamstill1451

    @iamstill1451

    9 ай бұрын

    What is the use of delta time I am new to all this so idk also this method is more simpler

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

    It said cannot convert ‘float’ to ‘string’. Pls help

  • @blazer6972

    @blazer6972

    11 ай бұрын

    same for me. I dont know why.

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

    i really never tried to make a game it'll be bad😐

  • @basicallyluci8048
    @basicallyluci80487 ай бұрын

    knowing how to define the jump key would be nice..

  • @Gamemaker_101

    @Gamemaker_101

    3 ай бұрын

    Thats Space

  • @slimecraft7620

    @slimecraft7620

    7 күн бұрын

    pretty sure that's what the Input.GetButtonDown is

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

    How do you set the jump key to a mouse click

  • @tntobi80

    @tntobi80

    Жыл бұрын

    for a left click its mousebutton 1 and right click mousebutton 2

  • @fillowskyy

    @fillowskyy

    Жыл бұрын

    if (Input.GetKey(KeyCode.LeftMouseButton)

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

    Lifesaver

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

    what do you mean about the jump float

  • @annoyingdog9646

    @annoyingdog9646

    Жыл бұрын

    He means make the character jump more like a person and less like a balloon

  • @SonicMonke

    @SonicMonke

    Жыл бұрын

    @@annoyingdog9646 no like when he says multiply by the jumjp float

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

    interact

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

    just as I guessed you're BRI'I'SH

  • @morebblakeyyy

    @morebblakeyyy

    Жыл бұрын

    Sherlock has arrived

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

    can you please give me the source code?

  • @X45Saucr

    @X45Saucr

    Жыл бұрын

    heres the script so i can save u $8.50 using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerJump : MonoBehaviour { private Rigidbody2D rb; public float jump; // Start is called before the first frame update void Start() { rb = GetComponent(); } // Update is called once per frame void Update() { if (Input.GetButtonDown("Jump")) { rb.AddForce(new Vector2(rb. velocity.x, jump)); } } }

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

    can I have the code?

  • @Hietakissa

    @Hietakissa

    Жыл бұрын

    @@unitylearning8736 that's not a better way of doing it, just different. In your example you are overriding the player's velocity, which may not always be wanted. Alternatively you could use AddForce but use ForceMode.Impulse and run it once so it works the same but doesn't override the velocity.

  • @unitylearning8736

    @unitylearning8736

    Жыл бұрын

    @@Hietakissa Not really overriding the velocity, we are setting velocity to equate to a locked Vector instead of instantiating a new Rigidbody velocity every frame. Say you want to create a variable that controls jump height, you will keep needing to add a new Rigidbody velocity.. Using this method, you can just modify the Vector2. Simple, easy, and much more efficient.

  • @Hietakissa

    @Hietakissa

    Жыл бұрын

    @@unitylearning8736 Yeah I guess I didn't fully read your comment. My point was that if the player were falling and jumped the downwards velocity would have no effect on the jump which may not always be desired, but that could easily be fixed just by setting the y velocity to rb.velocity.y + jumpForce instead. You could also use AddForce, so you still wouldn't be creating a new Vector3 every time you jump. Realistically this won't have any effect on performance but you are right it's better to just set the values of the existing Vector instead creating a new one and generating that 96 or so bits of garbage.

  • @ignacio3312

    @ignacio3312

    Жыл бұрын

    @@unitylearning8736 can you change the original code to match your changes?

  • @unitylearning8736

    @unitylearning8736

    Жыл бұрын

    @@ignacio3312 I can create a KZread video so that you will learn out of it. Also can create ground check function because I don't believe it is showcased here..

  • @DamiSel4137
    @DamiSel41375 ай бұрын

    What do I do with “Assets\playerJump.cs(20,58): error CS1002: ; expected”?

  • @skycloud97

    @skycloud97

    4 ай бұрын

    That means I think on line 20 there is no semi colon at the end

  • @slimecraft7620

    @slimecraft7620

    7 күн бұрын

    @@skycloud97 i tried that and it still doesn't work

  • @skycloud97

    @skycloud97

    7 күн бұрын

    @@slimecraft7620 i might have gotten that wrong do you know where the error line is? Or if you’re lazy like me use chatgpt to check it just throw the code and it will probaly fix it also i have took a long break from unity

Келесі