Isn't it wrong to use physics related stuff inside update?
@DenizSimsek
4 жыл бұрын
You are right. The physics related calculations, meaning adding force to a rigid body , should be in the FixedUpdate. My mistake here.
@mateusferreiramoreira5147
4 жыл бұрын
@@DenizSimsek That's absolutely fine. But, if may I ask, how would you o about jumping now? Toggling a bool in update so it can trigger the jump in fixed update?
@DenizSimsek
4 жыл бұрын
You can move the jump related code, toggling and adding force to the FixedUpdate method. Update can only be used for the movement now. FixedUpdate and Update can be used within a script file at the same time. Their execution time will differ.
@raik1766
3 жыл бұрын
@@DenizSimsek my collisionenter is not doing anything whatsoever /: this is the code im using: private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Ground") { OnGround = true; } }
@itstwilight7417
3 жыл бұрын
@@raik1766 You should use: if (collision.gameObject.CompareTag("Ground")) instead since it's more performent
@davidossuprimos9211
3 жыл бұрын
Thanks for making this, it worked first time for me. Which is high praise considering that for me most tutorials on youtube don't work the first time for me.
@JustinReeve
2 жыл бұрын
Thank you so so so much i've been trying to find a simple explanation of how to jump with a cube in unity and this is the perfect one Thank you!
@EverythingRox
3 жыл бұрын
This was the video I was looking for. Thanksss.
@ManjeetSingh-ry6is
3 жыл бұрын
Thanks a lot after 1 and a half day of watching videos and reading articles finally this worked thanks a lot you made my day
@hamzarashid7579
3 жыл бұрын
Thank you for this tutorial I am tired of searching how to jump the player only one time Thank you for this amazing tutorial
@huseyincansimsek9675
4 жыл бұрын
Your english is so fluently. I took an example by you.
@pyschofritz8955
Жыл бұрын
Hey man, thanks for the tutorial, just one question: When setting the variable back to "true" in the OnCollisionEnter() method, for me it does not set back to true. It becomes false when the user has jumped, but when landing it doesn't change back to true. I even checked to see if it the method was working by putting a Debug.Log and the method DOES execute, but the variable doesn't change. Any fix for this?
@fabianw8661
4 жыл бұрын
This Video is amazing! Great Job
@dirtroadgamer7276
2 жыл бұрын
Thanks man, this made it so simple!
@swiftcreations
4 жыл бұрын
Thanks a ton! I couldn't figure this out, and all the other tutorials broke my movement code, really underrated channel right here.
@waviation9
2 жыл бұрын
Let me guess, your movement code is for the Brackeys tutorial
@mauriciochapelle
4 жыл бұрын
You are awesome man, thanks for your tutorials! :D
@Elopo
4 жыл бұрын
Thank you bro you just saved me so much time subscribed
@epicfarts6622
3 жыл бұрын
I found a really good third person movement controller but it had no jump, this video was a lifesaver
@tS-gh9dj
3 жыл бұрын
What was the controller?
@MinhLuong1006
2 жыл бұрын
Thank you very much, the script is so simple. Subscribed.
@cashionsteven5695
2 жыл бұрын
holy, simple yet affective for me 😁 bro keep up :))
@neutralmichaelc
4 жыл бұрын
I love this tutorial so much. Thank u so much.
@jangronowski7450
4 жыл бұрын
finally a good turtorial its so hard to find these!!!
@kparody9846
3 жыл бұрын
I know
@Maggiethegsd
4 жыл бұрын
Just saying this, nothing is better than creating a new fresh unity project, knowing that you have around 10 hours for yourself, and make start out in visual studio with all your knowledge!
@DenizSimsek
4 жыл бұрын
I am addicted to fresh starts!
@SoulCatcher8965
Жыл бұрын
@@DenizSimsek I am too and very but i am getting un addicted to it which i think is good
@infernojoe
3 жыл бұрын
how did you get the smooth jumping? i tried every single thing i searched for on google, and on youtube, and none of them fixed my instant jump!
@davidmcasas
3 жыл бұрын
With this method, wouldn't you be able to climb-jump a large cube if it's tagged as ground? Because when you jump towards its side you are colliding with it thus triggering the ground condition. Correct me if I'm wrong.
@nonEuclideanExplosive
2 жыл бұрын
i aint no pro here, but you could place a invisible plane with tag ground thing and yeah. I realised whilst typing it aint perfect but ill leave it in case it helps
@vivekrmenon
3 жыл бұрын
Thank you soo much for this tutorial😍
@44Beats-1
10 ай бұрын
Thank you for this masterpiece!!!!
@darabyss9963
3 жыл бұрын
Hello i wanted to know how do i make the fall when i jump faster? is tooo slow and you can literally move in the air
@shrubbytunic1389
4 жыл бұрын
If you fall off then you can jump in mid air because you havent pressed "jump", I tried with OnCollisionExit, but didn't work any suggestions?
@mohammedabdeen9841
2 жыл бұрын
Thank you so much!!!! This was very useful
@danielberntsenomdal4853
2 жыл бұрын
Thanks bro, you help me a lot
@radical9619
3 жыл бұрын
May I ask how can I apply the nice lighting to my own unity game?
@gozdekgozdek
3 жыл бұрын
great tutorial! I want more!!!
@mustafadenizustaoglu106
3 жыл бұрын
Good work Dayi
@cwakoun350
3 жыл бұрын
So i found a bug in this code. You can fall off the ground without jumping and still be able to jump in mid air. A simple way to fix this is to add a OnCollisionExit method and set IsOnGround to false the same way you set it to true. And also its propably not very practical to tag everything you want to jump on. Besides that, the tutorial was great. Thanks! :)
@arpitsrivstva
2 жыл бұрын
My error is saying "the reference script on this behaviour (GameObject) is missing." PLease help!
@daizzer
2 жыл бұрын
It need else {BoolVar= false} I did it with out watching a tutorial because I wanted to practice what I learned about coding in a course, I have watch only 3 videos but I learned very good, I came here yo see how other people do it and im proud its similar, now I understand it better.
@tintlost2160
3 жыл бұрын
i change the name of "cubeisonground" to "playerOnGround" and did everything exacttly the same but it goes bad with my movement and just docent stop jumping, any idea what i might of done wrong?
@khurum
8 ай бұрын
great this helped me a lot in going to make game in unity called collectables there are various tasks you have to do like search for 3 bottles and 2 cars and etc...
@darkbf8493
2 жыл бұрын
Hocam ben third person için kamera kontrollerini brackeysin videolarından izledim. Senin burda yapmış olduklarınıda ekledim ancak jump bi türlü olmuyor.
@blakeskit
2 жыл бұрын
This was so helpful
@JuaDix
Жыл бұрын
Thank you so much you rly help me a lot
@akshatkumar7603
3 жыл бұрын
9:42 I had been having dis problem since a week..Ty I finally fixed it
@144hz_ichiro8
3 жыл бұрын
THIS CHANNEL IS AMAZING you helped me so much thx
@RyanGaming21
4 жыл бұрын
Thanks For THe Tutorial Man 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
@nikita_stefanov_
3 жыл бұрын
Thank you man. I had a big headache because of the "flappy bird" jump controls on my player.
@HawX192
4 жыл бұрын
Great Job with the tutorials! Hopefully you will continue them. Quick question, for example, when you jump on the platform and stay on the edge the player object will "fall" (change z axis rotation) how can i stop that? I added "rb.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionZ;" this stops that BUT if i stay on the edge on the platform long enough, then the object will walk on the side of the platform like a spider. How would one edit it, as to make the player "stand" on the edge but not fall, BUT also freeze the axis as to stop the side of the platform from becoming "the floor", i dont know if you understand what i mean.
@DenizSimsek
4 жыл бұрын
Thank you very much for your feedback. If I understand it correctly, you want the cube to stay on the edge without falling and not slide from the side of the platform. Right? If it is, I'll try to find a solution tomorrow.
@HawX192
4 жыл бұрын
@@DenizSimsek Basically yes, as long as 1 pixel is on the platform, the player wont fall, BUT if it falls, i want the player to stay in the upright position, right now it starts falling and it "lands on the face". I tried with the constraints as i said, but then the side of the platform becomes the new "down" or floor.
@HawX192
4 жыл бұрын
Ok I figured it out, to anyone wondering. Under the rigidbody component for the player, theres a little dropdown menu called constraints, tick the boxes for freeze rotation on x y z and now your player objects stays upright! :D
@DenizSimsek
4 жыл бұрын
Glad you figured it out. Have fun!
@simaolive4370
2 жыл бұрын
when I click the spacebar, nothing happens, I don't know if it's a project sentings problem please help me
@itzgrey6688
3 жыл бұрын
so it works fine but when I take the cube to a slope it glitches and I cant jump
@jameswalker6052
4 жыл бұрын
Very good tutorial.
@bobosmith101
7 ай бұрын
Won't this allow you to jump as long as you're touching a ground object, such as the side?
@nipzipz208
Жыл бұрын
I have I have some help because when you jump you slightly slow down and move normally when you touch the grounf
@aadi.124
3 жыл бұрын
Thanks, bro Loved it I finally made my cube jump after 3 weeks I move my cube
@aadi.124
3 жыл бұрын
bro why I fell down after some time I moved I am using capsule
@kaden7030
3 жыл бұрын
@@aadi.124 on your rigidbody control freeze the x y z constraints for rotation
@franpc386
3 жыл бұрын
UnassignedReferenceException: The variable rb of Move has not been assigned. You probably need to assign the rb variable of the Move script in the inspector. UnityEngine.Rigidbody.AddForce (UnityEngine.Vector3 force, UnityEngine.ForceMode mode) (at :0) Move.Update () (at Assets/Move.cs:29)
@jackjunior1439
2 жыл бұрын
I can still only jump once :(
@olayismitton1952
3 жыл бұрын
im getting an error from "OnCollisionEnter" it is say unexpected symbol my code is writen the same as you though any help?? thanks
@gipangr9747
Жыл бұрын
Is there a way to make shake camera when landing
@kushwah6804
3 жыл бұрын
even I tried this in unity but I was unable to jump once the player with the same code what should I do??
@user-gy6cw7sx3q
4 жыл бұрын
Thank you for this tutorial !
@DenizSimsek
4 жыл бұрын
Glad it was helpful!
@itsidza2198
Жыл бұрын
I have a character controller in my code too, but with a character controller the jump code doesn't work anymore, what can i do?
@pixeld2492
2 жыл бұрын
Thank you so much. I have a question that if i pressed “X” in a PS5 controller, will the character jump? If not, how do i do that?
@cubeheadexists
10 ай бұрын
To do that, look at the ps5 controller mapping for unity. That’s how I found out how to make a player jump in vr!
@pixeld2492
10 ай бұрын
@@cubeheadexists Thank you so much!
@wzzup24
2 жыл бұрын
“We’ll name his ass……w….w..we’ll name it as” Good video and a good laugh thanks man!
@deadbeamoth3744
3 жыл бұрын
for some reason when I used this code for my player, i could only jump once. I would jump once and then I wouldn't be able to jump again. There were no errors that Unity could find. How do I fix this?
@wyatt2299
3 жыл бұрын
Are you sure that EVERY piece of cube or whatever your ground is is tagged as Ground?
@lucasnasr8496
3 жыл бұрын
same thing is happening to me
@lucasnasr8496
3 жыл бұрын
just figured it out, my void OnCollisionEnter was not was indented. Make sure it isn't indented into the void update function.
@bierdl7641
3 жыл бұрын
just write if(collision.gameObject){}works too
@nomad2809
2 жыл бұрын
@@lucasnasr8496 not working
@Yujoon-ls8nk
2 ай бұрын
Hi I would aprecciate it if you could help I wrote public bool FeetIsGrounded = false; private void OnCollisionEnter(Collision collision) { if(collision.gameObject.tag == "Ground") { FeetIsGrounded = true; Debug.Log("Feet are grounded."); } } but it doesn't work. why?
@quarathunisahussain8416
3 жыл бұрын
I'm stuck. I can only jump once. The CubeIsOnTheGround box doesn't check again. Stays unchecked
@X0MB
3 жыл бұрын
You can fix it by going to the if collision thingie in private void oncollision and then in the if(collision.gameObject.name == "Your ground name") your ground name means whatever you have named your ground as put the name there, done it worked for me after doing that :)
@quarathunisahussain8416
3 жыл бұрын
@@X0MB Thanks!!
@milindbhandari
3 жыл бұрын
@@X0MB thanks a lot dude. i had the same problem. Solved it!!!
@mahnoorfaisal2751
3 жыл бұрын
@@milindbhandari The script doesnt work at all? I cant jump...do you have any tips?
@TeaShrooomPog
3 жыл бұрын
When i press space, the onGround bool turns off, but the player does not jump. Why?
@risingcode3909
3 жыл бұрын
for some reason its not working for me its telling me that the private OnCollisionEnter for this item is invalid
@colly9888
4 жыл бұрын
Thank you Deniz!
@ethankral3215
3 жыл бұрын
You are a savior btw
@thenukdevendra1902
3 жыл бұрын
Deniz sorry for basically spamming all your vids with ideas but I was wondering if you could do a tutorial on, "WaitForSeconds" and the "IEnumerator" functions.
@pratikshasuman4410
3 жыл бұрын
Thanks it HElp Me a Lot
@realrrnc
3 жыл бұрын
Guys pls anyone one answer, how can n make it the opposite direction in looking up and down
@charlesferry9465
4 жыл бұрын
Can you make this touch or button?
@drago7086
3 жыл бұрын
THANKS THAT HELPED
@nicktoelen3479
4 жыл бұрын
Why is it so difficult to find such good tutorials?!!
@kenpalarold9476
4 жыл бұрын
its number 1 if you search unity how to jump 3d soo for me it was not
@arpitsrivstva
2 жыл бұрын
Because most of the people are ... you know..
@SkorpionYassine
Жыл бұрын
this one is bad trsut me
@prokeikas7284
4 жыл бұрын
But what if I want to add a double jump?
@pedrofernandes8984
4 жыл бұрын
Thank you so much!!
@jakesmeef0323
4 жыл бұрын
I think I did something wrong, so I followed the tutorial doing the same code as you but I can only jump once and after I land I can’t jump again, what’s happened?
@thenukdevendra1902
3 жыл бұрын
probs you not set the varible back to true so you can jump again? Or something might not match in the script and your tags or names
@spyzn
3 жыл бұрын
@Jake Smeef03 This should help void OnCollisionEnter(Collision collision) { if (collision.collider.tag == "Ground") { groundCheck = true; } else { groundCheck = true; } }
@DemonPig666
3 жыл бұрын
@@spyzn thx i know im not him but this helped me a lo9t
@spyzn
3 жыл бұрын
@@DemonPig666 no problem :) always happy to help.
@lucasnasr8496
3 жыл бұрын
make sure your void OnCollisionEnter is indented to the right area. Make sure it isn't within the void update function
@axera1762
4 жыл бұрын
Thank you
@gautamgarg7377
3 жыл бұрын
Thank you very much.
@v3vlog
4 жыл бұрын
Great video 👍
@DenizSimsek
4 жыл бұрын
Thanks 👍
@maoguai
3 жыл бұрын
why my character jump still flying when I take the code to the input event.... I already have rigidbody..
@icantnames8533
4 жыл бұрын
one problem with this is if the platform was taller than you could jump off the side infinitely, any idears to fix this?
@TheThursty100
4 жыл бұрын
my thought exactly. probably need to tag it as something else and put an object with ground on top of it
@bavvireal
3 жыл бұрын
thx. great vid
@mikethegamedev
3 жыл бұрын
Nice thanks so much!
@paxl6635
3 жыл бұрын
Thank you!
@sssmaxs2615
4 жыл бұрын
can you please copy and paste the script ? plz
@reelingthefish23
3 жыл бұрын
Hello dude great tutorial, I am stuck on private void OnCollisionEnter(collision collision) { if(collision.gameObject.name == "Floor"){ cubeIsOnTheGround = true; it says on my problems "message": "The modifier 'private' is not valid for this item [MiscellaneousFiles.csproj]", Any Help?
@EverythingRox
3 жыл бұрын
I think you might have put ur code inside void update() . Just move it outside, it should work fine.
@Rodehaas
2 жыл бұрын
But this only works if the bottom game object is called floor, so you have to add everything by hand for different floor objects, inefficent.
@Sfh70979
4 жыл бұрын
how if I use Character Controller instead of Rigid Body? Can I use both of them?
@DenizSimsek
4 жыл бұрын
You don’t need to use Rigid Body with Character Controller, because with that you control the character without physics. With Character Controller you just give a y position to your player when the Jump button pressed down. If you want to keep the Rigid Body and use Character Controller for jumping then you should disable gravity from the Rigid Body, I think.
@Sfh70979
4 жыл бұрын
@@DenizSimsek okay.. thanks..
@Baablithegodofdarkness
7 ай бұрын
i got error CS1003: Syntax error, ',' expected while making bool pls help
@ChA0s_kInG
3 жыл бұрын
ok so for me it says that there is no input button for jump even though its in the project settings how do i fix this?
@ChA0s_kInG
3 жыл бұрын
so i fixed that by renaming it but now it does not jump
@zartoz777
Жыл бұрын
How to do it so it can jump while its moving
@foxi7463
3 жыл бұрын
I'm stuck. I can only jump once. The CubeIsOnTheGround box doesn't check again. Stays unchecked. Edit: Nevermind, fixed it somehow, don't ask me how lol.
@NONSTOP-or5mu
3 жыл бұрын
Damn, I have the same problem....
@beastmasterbg
3 жыл бұрын
same problem ,how did you fix it
@wagon7052
4 жыл бұрын
i rly wish that you didnt stop filming nice tutorial btw ty a lot
@DenizSimsek
4 жыл бұрын
I plan to make more tutorials soon. Thank you for your comment!
@wiljuniorelcrack4144
4 жыл бұрын
Hey, I have a problem, the thing is that I can't jump when I jumped, I mean, I can only jump once, after that I can't jump, I know it's because of the position but I don't know how to solve it, help please
@spyzn
3 жыл бұрын
This Should Help! void OnCollisionEnter(Collision collision) { if (collision.collider.tag == "Ground") { groundCheck = true; } else { groundCheck = true; } }
@wiljuniorelcrack4144
3 жыл бұрын
@@spyzn thanks!
@spyzn
3 жыл бұрын
@@wiljuniorelcrack4144 no problem man, happy to help
@Zyifo
3 жыл бұрын
how do you fix your player jumping only once
@FickleHydra
Жыл бұрын
wait it jumps on the side of it, how would i fix that?
@kiddoswithviddos5589
3 жыл бұрын
finally a good tutorial
@ferasalfarsi897
10 ай бұрын
Thank you for the video, but please, zoom in, so we can see clearly the letters is very small.
@FuS1oNDaBest
Жыл бұрын
for me after I jump my character slowly goes in the air , yk why?
@Costliness
4 ай бұрын
Eyvallah reis çok sağolasın
@tanmaysinghal8370
4 жыл бұрын
Even though it is not jumping in the air But when it comes to ground then 'cubeisonground' doesn't checks to true..... due to which it doesn't jump any more.....
@DenizSimsek
4 жыл бұрын
The cube needs to collide with a game object which has a tag of “Ground” when it is landed
@tanmaysinghal8370
4 жыл бұрын
@@DenizSimsek it is colliding when it falls down.....
Пікірлер: 237