ULTIMATE 2D Platformer Controller for Unity

ULTIMATE 2D Platformer Controller for Unity

Sasquatch B Studios

11 месяцев назад

34,325 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@katonnicgaming4426
@katonnicgaming4426 - 12.04.2025 03:11

im so confused idk how to start doing this help

Ответить
@katonnicgaming4426
@katonnicgaming4426 - 12.04.2025 03:02

how do i get the player movement stat unity asset thingy?????????

Ответить
@HerbertZocker
@HerbertZocker - 11.04.2025 12:54

Did i miss something, or is JumpIsHeld never actually used? Unfortunatly the bad IDE he's using in this video doesn't show usages/ grays out unused things.

Ответить
@katonnicgaming4426
@katonnicgaming4426 - 10.04.2025 05:30

how do i create new player movement???

Ответить
@thegames7038
@thegames7038 - 01.04.2025 18:33

Clean code

Ответить
@dan1elr
@dan1elr - 27.03.2025 06:38

Really cool, works well. However, I honestly can't figure out why I can jump more than the number of allowed jumps. If I set the number of allowed jumps to 1, it works perfectly. However, anything above just lets me jump infinitely. I guess the counter doesn't reset...?

Ответить
@patrickmayer9218
@patrickmayer9218 - 08.03.2025 19:51

Some tips for people following along in 2025

1. If you're using the new input system, you're going to want to have separate variables for jumpPressed and jumpReleased, which you can set up like this:

public void JumpAction(InputAction.CallbackContext context){
if (context.started || context.performed){
Debug.Log("Recognizing jump");
jumpPressed = true;
jumpReleased = false;
}else if (context.canceled){
jumpPressed = false;
jumpReleased = true;
}
}

2. I would recommend naming the timer variables something else, as it is super easy to accidentally type jumpBufferTime instead of JumpBufferTimer.


Thanks for the video, Sasquatch!

Ответить
@wicksley
@wicksley - 02.03.2025 12:03

Amazing, thank you :D

Ответить
@KanoBaphomet
@KanoBaphomet - 28.02.2025 00:53

I can move and jump, but when the character jumps, it gets stuck in the air. Suddenly, I'm able to move the character as if walking, but while still in the air.

Ответить
@metebasbozkurt9598
@metebasbozkurt9598 - 22.02.2025 09:32

I did everything until the test section in the first half of the video, but the character turning around itself. I don't want this and I couldn't figure out why, can you help me?

Ответить
@sevenfacts3398
@sevenfacts3398 - 09.02.2025 00:55

Absolutely like, comment and recommends it!

Ответить
@j.m.g_yt2320
@j.m.g_yt2320 - 16.01.2025 17:37

the textsize of code is too small my eyes is hurting me but thx for the wonderful content...<3

Ответить
@spetauskas
@spetauskas - 16.01.2025 13:07

first video then i don't have play video on <1.5 playback speed. thank you.

Ответить
@nike-c8l
@nike-c8l - 07.01.2025 11:50

I double checked the code, but I didn't press any buttons and the character kept jumping. Who knows what's going on.

Ответить
@Elenyen
@Elenyen - 04.01.2025 18:16

Your code is perfect example of clean code 🔥

Ответить
@erikmarchini3274
@erikmarchini3274 - 03.01.2025 11:38

I wrote "Run" in the Code, it didn't work, "Sprint" did, it took me 1 hour to resolve the issue...
The "DebugShowIsGroundedBox" thing is just impossible to figure out right now...

Ответить
@SadTown99
@SadTown99 - 01.01.2025 21:15

Geeeeeez 😵‍💫 What a freakin’ gold mine of a channel this is…
Thank you dude ‼️

Ответить
@tensura-x74
@tensura-x74 - 10.12.2024 16:17

I cant move how do i fix this someone help

Ответить
@princessbaeex
@princessbaeex - 28.11.2024 22:39

I get a error for the movement stats that I cannot convert from double to float what does that even mean🤧

Ответить
@degrees97
@degrees97 - 26.11.2024 22:28

Great character controller I love the feel of it. However it doesn't handle slopes well from my experience. I did some changes while learning from your video but I don't think they caused the behaviour that happens, when you go down a slope the player basically hops down. I already tried to change the feet collider to a capsule and created a new variable "isOnSlope" that checks the angle of the normal that the "isGrounded" raycast hits but I'm having trouble finding the piece of logic where I could use it to smoothly handle slopes.

I would greatly appreciate your input and am sure this would be a great addition to an already amazing character controller :)

Ответить
@Dragon_Master
@Dragon_Master - 18.11.2024 03:37

Hello so I'm trying to use this to test if I want it for my game and for some reason, I can just jump infinitely in the air why? Also Any suggestions on other game tutorials for my game. This is the first time i'll be making my own game and I don't really know what I'm doing lol.

Oh also there was a weird thing where my Update, Awake, and FixedUpdate Functions were like making seem as though they weren't premade functions. Cause in his video those functions were in blue text but mine were in yellow. And when my functions are in yellow it means it's a function I have to/create so maybe it's that IDK.

Ответить
@乾淨核能
@乾淨核能 - 10.11.2024 08:45

wow a god sent video, thank you!

Ответить
@capilover1023
@capilover1023 - 05.10.2024 18:25

Gravity works, but the player doesn't move when the keys are pressed. New project, empty scene. I copied everything you did, including your input actions and inspector settings. Unity 2022.3.8f1

Ответить
@siimmae4009
@siimmae4009 - 05.10.2024 05:24

really great tutorial. thank you!

Ответить
@restingsox9022
@restingsox9022 - 22.09.2024 07:31

How to do state machine?

Ответить
@werter7779
@werter7779 - 18.09.2024 21:38

i guess.. i will can not add an other platformer movement mechanics after all by myself😅

Ответить
@blasterxt9
@blasterxt9 - 15.09.2024 00:03

Buddy explains the new input system of unity

Ответить
@job1481
@job1481 - 23.08.2024 22:53

Hey thanks. Is there a reason why you didn't switch the rigid bodys to kinematic if you don't need the actual dynamics like you said in the beginning?

Ответить
@K1smet115
@K1smet115 - 18.08.2024 01:11

I've copied your code to a T but my character flips dramatically to the other side of the screen and doesn't move. Not too sure what I did wrong. It doesn't work.

Ответить
@Fracturedgraphic
@Fracturedgraphic - 17.08.2024 23:27

Great walkthrough!

Ответить
@dynamogames.
@dynamogames. - 15.08.2024 17:51

Great Platformer Tutorial! Although, it took a while before I was able to type all the lines of code.
I had a few issues when implementing this, first I noticed you didn't talk about the camera and what type of camera to be used, I'm using cinemachine but I'm getting weird results when moving the player, the camera is a bit wobbly and when I press Left Arrow Key or A key, the camera moves to the right instead of the left not following the player, but when I press the Right Arrow Key, it works at it should. I'm not sure you factored when the player moves left in the PlayerMovement script.

I also noticed the player keeps jumping when I press spacebar multiple times, the effect of gravity does not really work. I messed with values of MaxFallSpeed, TimeTillJump Apex and some others but it was to no avail.

Ответить
@douick
@douick - 14.08.2024 18:50

thanks you for your awesome tutorial, but how do you handle inclined plane like stairs ?

Ответить
@cadafinn
@cadafinn - 17.07.2024 20:28

tus videos me ayudan a seguir adelante, hay muchas cosas que debo aprender de unity, Me encanta personalizar la jugabilidad del personaje.

Ответить
@Knife8
@Knife8 - 16.07.2024 12:03

can u upload the code?

Ответить
@толькохардкор-г7е
@толькохардкор-г7е - 10.07.2024 15:21

Dude, you have no idea how much you helped me. Thank you very much! We need more of these videos! :)

Ответить
@josegarcia755
@josegarcia755 - 16.06.2024 05:05

this did not work for me. Not sure what i did wrong.

Ответить
@beatrageGameSalad
@beatrageGameSalad - 11.06.2024 14:31

Nice tutorial!

Ответить
@StressedProgrammer
@StressedProgrammer - 08.06.2024 13:23

How can i try this?

Ответить
@AnEmortalKid
@AnEmortalKid - 07.06.2024 07:56

This reminds me of the plarformer toolkit by GMTK

Ответить
@soufianebenamer7585
@soufianebenamer7585 - 07.06.2024 04:43

Please can you zoom in a little bit the script that I can see it clairly and thank you so much for these great tutorials .

Ответить
@Pandaluf
@Pandaluf - 07.06.2024 00:17

I absolutely love your tutorials they have been SO helpful in setting up my game cannot thank you enough for these

Ответить
@veerajukuri
@veerajukuri - 06.06.2024 19:22

definitely going to be looking over my jump after watching this, all the adjustability seems really useful. i have to ask though, do you have thoughts on implementing movement via AddForce instead of straight velocity changes? seems to me like implementing knockbacks or such would be a lot simpler if movement is done with AddForce? really grateful for all the videos so far, they've helped tremendously in setting up various systems.

Ответить
@Firestone-Games
@Firestone-Games - 06.06.2024 17:31

Awesome Tutorial, as always.

Ответить
@midniteoilsoftware
@midniteoilsoftware - 06.06.2024 16:23

Fantastic!

Ответить
@dogmuncher_69
@dogmuncher_69 - 06.06.2024 15:47

perfect features for my game

Ответить
@fireraccoon_
@fireraccoon_ - 06.06.2024 15:38

Oh. That is super cool and nice!

Ответить
@NameThinkerGames
@NameThinkerGames - 06.06.2024 15:23

Thanks for sharing that, it certainly would be helpful for beginners who wants to build a platformer. Although I've noted few things in your tutorial which will make it certainly harder to support and add more features to the controller. Since you're changing velocity of rigidbody directly without using AddForce, you are basically killing possibility to interact with other objects such as Surface effector for example, since it applies a force to a rigidbody in a specific direction, it also will be hard to make a moving platform work flawlessly with that, since you would have to figure out how to add velocity of platform to the player and conserve momentum during jumps. Overall good job, keep it up

Ответить