In this tutorial We want to see how to check jumping and stop character(player) to fly when space pressing continuous in a 2d platform game on unity engine with easy c# scripts.This tutorial we can learn step by step process to move the character(player) in 2d game.I wish you can learn this easily.I will explain with screenshots and videos.Lets go to tutorial.Its not much harder
Before enter this tutorial you want see these tutorials
- How to move player here.
- Flip the player tutorial here.
- How to animate here.
- How to make jump player here
1.Now You know how to move and flip then animate and jump that player.but while jumping we can see player fly when space continuously now i am going to tell you to how to jump the player when with checking the ground and make jump.
2.Click the player on the hierarchy right click on it and create empty object
3.add the box collider 2d on that gameobject.
4.make sure that box collider 2d present in the bottom of the player.
5.create a new script
6.name it as jumpcheck
7.drag the script to the gameobject
8.Create an empty object in Hierarchy.
10.name it as ground.
11.create a new tag for ground.
12.click plus simbol.
13.save it as ground.
14.select ground tag to ground object.
15.Add the edge collider.
16.Click the edit collider and edit collider as ground.
17.open the playercontrol script and add these
18.Now open the jumpcheck script and Add,
19.Now open the player control script and add,
20.Save these scripts.
21.Then start the game.If any error comment me(download script)
Check out this tutorial in this video,
If is it usefull and you want more videos subscribe my channel subcribe my youtube channnel
2.Click the player on the hierarchy right click on it and create empty object
3.add the box collider 2d on that gameobject.
4.make sure that box collider 2d present in the bottom of the player.
5.create a new script
6.name it as jumpcheck
7.drag the script to the gameobject
8.Create an empty object in Hierarchy.
10.name it as ground.
11.create a new tag for ground.
12.click plus simbol.
13.save it as ground.
14.select ground tag to ground object.
15.Add the edge collider.
16.Click the edit collider and edit collider as ground.
17.open the playercontrol script and add these
18.Now open the jumpcheck script and Add,
19.Now open the player control script and add,
20.Save these scripts.
21.Then start the game.If any error comment me(download script)
Check out this tutorial in this video,
13.save it as ground.
21.Then start the game.If any error comment me(download script)
Check out this tutorial in this video,
If is it usefull and you want more videos subscribe my channel subcribe my youtube channnel