I absolutely love your tutorials they have been SO helpful in setting up my game cannot thank you enough for these
@og_jankypanky3 ай бұрын
Great tutorial!! @18:00 you mention trying to account for max fall speed to DrawJumpArc curve. I added a float terminalVelocityTime = Mathf.Abs(MoveStats.MaxFallSpeed/MoveStats.Gravity), just before you start iterating timeSteps. Then in the descending else section first remove the last line. Your horizontal velocity will be the same throughout so you can calculate a total horizontal displacement of new Vector2(speed, 0) * descendTime (just adding this to displacement is fine) then: If your descendTime is less than that terminalVelocityTime you add 0.5f * new Vector2(0, MoveStats.Gravity) * Mathf.Pow(descendTime, 2) to displacement Else you'll add 0.5f * new Vector2(0, MoveStats.Gravity) * Mathf.Pow(terminalVelocityTime, 2) for the gravity accelerated component and then add new Vector2(0, -MoveStats.MaxFallSpeed) * (descendTime - terminalVelocityTime) for the remaining fall at terminal velocity.
@толькохардкор-г7е6 ай бұрын
Dude, you have no idea how much you helped me. Thank you very much! We need more of these videos! :)
@RakuraiBlader2 ай бұрын
Since you got it, do you know what "UnityEngine.InputSystem" is? I'm getting several problems because Unity doesn't recognize the type/namespace.
@SadTown999 күн бұрын
Geeeeeez 😵💫 What a freakin’ gold mine of a channel this is… Thank you dude ‼️
@Firestone-Games7 ай бұрын
Awesome Tutorial, as always.
@libberator58917 ай бұрын
18:12 OnDrawGizmos isn't called in a Build, so turning it off or leaving it on won't make a difference.
@beatrageGameSalad7 ай бұрын
Nice tutorial!
@Fracturedgraphic4 ай бұрын
Great walkthrough!
@siimmae40093 ай бұрын
really great tutorial. thank you!
@乾淨核能2 ай бұрын
wow a god sent video, thank you!
@cadafinn5 ай бұрын
tus videos me ayudan a seguir adelante, hay muchas cosas que debo aprender de unity, Me encanta personalizar la jugabilidad del personaje.
@fireraccoon_7 ай бұрын
Oh. That is super cool and nice!
@NameThinkerGames7 ай бұрын
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
@Razofgal7 ай бұрын
A "simple" solution to the moving platforms is to make the player a Child of the platform when they hit it, and dechild the player when they jump - this wont save momentum though.
@maxiecoates81082 ай бұрын
@@Razofgal Simple solution which actually introduces loads of other problem, you now have a massive pain when dealing with anything that moves which imo is an essential part of any 2d platformer. For me this controller isnt flexible enough to support the core components of 2d platformer.
@degrees97Ай бұрын
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 :)
@douick5 ай бұрын
thanks you for your awesome tutorial, but how do you handle inclined plane like stairs ?
@erikmarchini32748 күн бұрын
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...
@blasterxt93 ай бұрын
Buddy explains the new input system of unity
@soufianebenamer75857 ай бұрын
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 .
@midniteoilsoftware7 ай бұрын
Fantastic!
@veerajukuri7 ай бұрын
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.
@AnEmortalKid7 ай бұрын
This reminds me of the plarformer toolkit by GMTK
@job14814 ай бұрын
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?
@Dragon_MasterАй бұрын
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.
@nike-c8l4 күн бұрын
I double checked the code, but I didn't press any buttons and the character kept jumping. Who knows what's going on.
@dynamogames.4 ай бұрын
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.
@dynamogames.4 ай бұрын
I also noticed if I press the jump button and immediately hold the right arrow key or D key, the player hangs in the air and is not affected by gravity but if I press the spacebar key when stuck in the air, the player then comes down to the ground.
@Knife85 ай бұрын
can u upload the code?
@princessbaeexАй бұрын
I get a error for the movement stats that I cannot convert from double to float what does that even mean🤧
@benzinaria8 күн бұрын
Make sure you use Mathf and NOT Math in line Gravity = -(2f * JumpHeight) / Mathf.Pow(TimeTillJumpApex, 2f);
@werter77793 ай бұрын
i guess.. i will can not add an other platformer movement mechanics after all by myself😅
@eva-nf9fl4 ай бұрын
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.
@benzinaria8 күн бұрын
Make sure you freeze the z axis on the rigidBody2D
@tensura-x74Ай бұрын
I cant move how do i fix this someone help
@restingsox90223 ай бұрын
How to do state machine?
@josegarcia7556 ай бұрын
this did not work for me. Not sure what i did wrong.
@tensura-x74Ай бұрын
Same
@capilover10233 ай бұрын
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
@alendugalic6922Ай бұрын
I had this as well until i played back and noticed something he doesn't talk about. In your input manager that's in the scene you have to make sure it has a player Input component and your Input actions attached. Hope this fixes the problem :)...also make sure your naming matches your input actions naming
@tensura-x74Ай бұрын
@alendugalic6922 can u pls explain exactly what to do im haveing this problem but I'm a beginner so I didn't fully understand what u said