Move To Any Specific Part Of The Video(Click Below): 1. 00:00 - Intro 2. 00:50 - Explaining The Movement Code 3. 01:36 - Creating The Jump Function 4. 04:03 - Making The Jump Better 5. 05:18 - Fixing Multiple Jumping 6. 07:07 - Code for Ground Check 7. 11:50 - Final Play Testing [Get My New Course] Build 20+ Mini projects with Unity : bit.ly/3bLn4Ns
@saqibjaved1900 Жыл бұрын
God bless you brother, i've been stuck on ground check for last two days, and your this video solved my issue, thank you soo much. Keep doing this amazing stuff. subscribed,liked 🙂
@ChargerGames Жыл бұрын
Glad I could help , Happy Learning :)
@prathamesh_sinha3 жыл бұрын
You actually saved my life. An important game jam was too close(4 days) and i hadn't even done at least 30% as i was stuck in the ground check function. today after watching 17 waste videos, came to you and saved my life tho have my sub and like for sure. hope you keep on making awesome videos like this and grow up your channel. best of luck for your cool future!😘
@Mbuso.B.Dlamini4 жыл бұрын
You r so underrated bro I’m surprised that you dont have a Million subscribers yet
@ChargerGames4 жыл бұрын
Thanks for supporting bro.. I'll keep try to keep uploading irrespective of my subscriber count :)
@lordcatington81884 жыл бұрын
Loving all the videos coming out recently!
@ChargerGames4 жыл бұрын
Glad to know it.. :)
@CatStorm-gb5bx3 жыл бұрын
I already had a jumping mechanic so i didn´t need the first parts of the video. But the Ground check worked perfectly with my script. So thank you for that.
@HugiHugison4 жыл бұрын
After trying for hours, your video was the one that really helped me
@ChargerGames4 жыл бұрын
Glad it helped :)
@EricGames117 Жыл бұрын
Thanks! Super new to Unity (and C#) and everyone else has such complicated ways to program this. Thanks for making it simple!
@ChargerGames Жыл бұрын
Glad it was helpful!
@williamlima48774 жыл бұрын
Im brazilian, and i was having bugs on my game! And this video show me a geniusly way to solve it! You r amazing bro!!!
@Abdul-pe5rf4 жыл бұрын
I love your tutorial, unlike a lot of other creator, I understand everything you said.
@digijam35683 жыл бұрын
Thank you very much for this! I was having an absolute nightmare trying to stop the double jump, your suggestion is the only one I have found that actually works :)
@jakuba50503 жыл бұрын
Best Ground Check tutorial i've ever seen. Great work!
@mugan864 жыл бұрын
Thank you very much for the tutorial, very clear and very well structured, raising the complexity in an intelligent way. I'm negatively surprised that you don't have more subscribers since the content you offer is very very good. Congratulations and thanks again! p.d.- here a follower who will be attentive to new content with the bell activated;)
@pavelpolosin2217 Жыл бұрын
Thanks man. I tried to create ground checking system with Physics2D.Raycast, and with Physics2D.Linecast, but only with your way (OverLapCircle), I finally made it!
@ChargerGames Жыл бұрын
Glad I could help!
@adhviklalthoppe22144 жыл бұрын
I love ur vids and without u I would have no C# knowledge so thank u for everything u do
@ChargerGames4 жыл бұрын
Thank You, I'm so happy to know that I could help you learning :)
@subhanatakisiyev78304 жыл бұрын
thank you! i couldn't fix groundcheck for weeks!
@davestomper34284 жыл бұрын
Hi liked the video some really good information thanks. My question is if you had a game and let's say you use space bar to swim up I think original Super Mario Bros used the jump button and the swim up button using the same button. So in this case would a ground check be a problem would it need to be done differently somehow. I want to add swimming to a few levels
@ChargerGames4 жыл бұрын
Are you a Student in any of My Udemy Courses?
@sarthakghodke72504 жыл бұрын
Yes
@V.Z.694 жыл бұрын
Ah, I've taken course on Udemy. I was studying 3D modeling and Rigging. No time to continue that right now. But it's fair that you are on Udemy. Your time is important and you can't just rely on KZbin to pay for your content even if it is monetized. Besides, a bikini-haul get's millions of views and it takes zero effort and no talent. That's the world, a sexy model makes millions when engineers struggle to make 70K a year.
@AliHaider-jy1pr4 жыл бұрын
Dont know teacher why are you soo underrated by the way i am learning from your course and its awsome teacher thank you 😍.
@ChargerGames4 жыл бұрын
Thank you! 😃 Which course have you taken?
@sarthakghodke72504 жыл бұрын
Love your videos bro
@ChargerGames4 жыл бұрын
Thanks man
@roadtrpr4 жыл бұрын
made it possible for me to integrate with other source code and go little "off piste" and improvise here. Many thanks. Really good explained.
@kuttykoranguedits11542 жыл бұрын
LOVE FROM TN ❤️🤩
@Game-Echo19883 жыл бұрын
Thank you so much. this is exactly what I needed
@harshitabakre37144 жыл бұрын
Thanks i really wanted this
@ChargerGames4 жыл бұрын
Good timing for you :D
@abhizidane34 жыл бұрын
Hi Raja ... amazing video as always...
@ChargerGames4 жыл бұрын
Thanks Abhishek :)
@amazingproducts-sahilview39163 жыл бұрын
thanks sir for this amazng tutorial.
@MrGoldenBee4 жыл бұрын
Thanks for the tutorials
@ChargerGames4 жыл бұрын
Thanks for checking out :)
@OkaToka2 жыл бұрын
For a some reason in my case character doesn't jump everytime I press jump button, but skips 2-3 presses.
@SumanDeyMusic4 жыл бұрын
Wow.. sueprb video 😁😁
@ChargerGames4 жыл бұрын
Thanks a lot 😊
@bezinteresa68064 жыл бұрын
Шикарные видео. Хочу попробоваать сделать игру, но лень начинать)))
@ChargerGames4 жыл бұрын
Keep Learning :)
@AliHaider-jy1pr4 жыл бұрын
Teacher would you please make videos on unity animation .. i learn a lot from you..
@ChargerGames4 жыл бұрын
Ya sure.. :)
@DavezinhoDDR4 жыл бұрын
i'm having trouble cuz i'm using some sloped platforms. It adds too much force when i'm running and too less when i'm standing in them. Plz help
@techbit76073 жыл бұрын
Once I add this code my character slightly bounces a little bit, how do I stop that from happening?
@amazingproducts-sahilview39163 жыл бұрын
sir how i can code a player to dig the ground.
@1Happy_Singh4 жыл бұрын
Please Make A Vudeo On " Spring Joints "
@Diamond-yn4nu4 жыл бұрын
Nice video keep going 🖒
@padilla1903 жыл бұрын
WHAT IM DOING BAD ;C if (Input.GetKeyDown(KeyCode.Space)) { if(isGrounded){ Jump(); Debug.Log("Algo anda mal"); } Debug.Log("precionaste espcacio"); } i put a debug.log to confirm if i pressed space and it works but now my player doesnt jump ;/
@gk92573 жыл бұрын
you are awesome! Thanks
@Galaxy_World2 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object PlayerMovement1.Jump () (at Assets/Scripts/PlayerMovement1.cs:10) PlayerMovement1.Update () (at Assets/Scripts/PlayerMovement1.cs:26) :|
@tinycole12393 жыл бұрын
I keep getting a bug that says "Physics2D" does not contain a definition for 'OverLapCircle'. Does anyone know how i can fix that?
@patrikpatrik25322 жыл бұрын
type OverlapCircle instead of OverLapCircle
@timovh25273 жыл бұрын
Thank you so much!
@bhaskarakeerthi22354 жыл бұрын
iam not able to find the script for walking cat
@keyinteriordesigners23903 жыл бұрын
Hi in my 2D game public float doesn't work I used it as public float speed but the float didn't work but it works for my 3D game
@picklezszs2 жыл бұрын
what a W tysm
@st3fke8824 жыл бұрын
Hi it wont work for me, can you help? I didnt recive any errors. Code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Movement : MonoBehaviour { private Rigidbody2D rb; public float movementSpeed; private Animator myAnimator; private bool facingRight; private bool attack; public float jump; bool isGrounded; public Transform groundCheck; public LayerMask groundlayer; void Start() { facingRight = true; rb = GetComponent(); myAnimator = GetComponent(); } void Update(){ HandleInput(); } void FixedUpdate() { float horizontal = Input.GetAxis("Horizontal"); HandleMovement(horizontal); Flip(horizontal); HandleAttacks(); ResetValues(); isGrounded = Physics2D.OverlapCircle(groundCheck.position,1f, groundlayer); } private void HandleMovement(float horizontal) { if (myAnimator.GetCurrentAnimatorStateInfo(0).IsTag("Attack")) { return; } rb.velocity = new Vector2(horizontal * movementSpeed, rb.velocity.y); myAnimator.SetFloat("speed",Mathf.Abs(horizontal)); } private void Flip(float horizontal) { if (horizontal > 0 && !facingRight || horizontal < 0 && facingRight) { facingRight = !facingRight; Vector3 theScale = transform.localScale; theScale.x *= -1; transform.localScale = theScale; } } private void HandleAttacks() { if (attack) { myAnimator.SetTrigger("attack"); } } private void HandleInput() { if (Input.GetKeyDown(KeyCode.Space)) { if (isGrounded){ rb.velocity = new Vector2(rb.velocity.x, jump); } } if (Input.GetMouseButtonDown(0)){ attack = true; } } private void ResetValues(){ attack = false; } }
@kushagrajaiswal40662 жыл бұрын
It shows physics2d does not exist??
@hassanmaswedish22903 жыл бұрын
Thank you raja baja
@alibayat13364 жыл бұрын
thank you!
@radjagunasilinjulia84354 жыл бұрын
Make one video for visual scripting ..
@ChargerGames4 жыл бұрын
Yes, I want to create a video on Bolt Visual Scripting
@coleslaw76892 жыл бұрын
So I have been trying this and it seems that I might've done something wrong because I keep on getting an error so can someone please tell me (btw I added a different movement script I'm also new to scripting) This is my script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class NewBehaviourScript : MonoBehaviour { public float jump Force(); public float moveSpeed = 5f; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, 0f); transform.position += movement * Time.deltaTime * moveSpeed; if (Input.GetKetDown(KeyCode.Space)) { jump(); } } void Jump() { rb.velocity = Vector2.up * jumpForce; } }
@sabrinahafenberg72412 жыл бұрын
the "public float jump Force()" is wrong it should be "public float jumpForce;" Then it's right. The whole script would be then: using System.Collections; using System.Collections.Generic; using UnityEngine; public class NewBehaviourScript : MonoBehaviour { public float jumpForce; public float moveSpeed = 5f; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, 0f); transform.position += movement * Time.deltaTime * moveSpeed; if (Input.GetKetDown(KeyCode.Space)) { jump(); } } void Jump() { rb.velocity = Vector2.up * jumpForce; } }
@pewpewjello79044 жыл бұрын
nice!
@darealspawn3 жыл бұрын
All works but when up arrow key is pushed the y movement is happening :) should this happen. I guess i need to remove the yInput part :)
@quikx85204 жыл бұрын
I did not get the notification?
@ChargerGames4 жыл бұрын
You can press the Bell icon beside subscribe button, if you're not getting notifications. I have also uploaded Double Jump video few Today..
@justusisbestest41222 жыл бұрын
THANK YOU SO FUCKING MUCH OMG
@ChargerGames2 жыл бұрын
Glad it helped :)
@justusisbestest41222 жыл бұрын
@@ChargerGames my jumping was bugged but thanks to u it worked :D
@kartikpathak6294 жыл бұрын
Bro WHEN WILL MOBILE FPS COME??????????
@mannou383 жыл бұрын
BRUH WHY IS THIS NOT WORKING- this is so embarassing. i have been using unity for over 3 years at this point yet i cannot get this to work. i literally was going to code this myself in 5 minutes yet here i am spending hours stuck.. player doesn't move at all. i tried everything.
@senthilkumar69224 жыл бұрын
Please reply your language
@hassanmaswedish22903 жыл бұрын
Raja the kala
@STEEZY2BREEZY4 жыл бұрын
6th comment yessir >:)
@ChargerGames4 жыл бұрын
Yay
@STEEZY2BREEZY4 жыл бұрын
@@ChargerGames OMG NO WAY YOU RESPONDED YOU ARE MY FAVIROTE KZbinR OMGGGGGGGG HIIII