In this tutorial We want to see how to jump character(player) 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
1.Now You know how to move and flip them animate that player.now i am going to tell you to how to jump the player when pressing spacebar.
2.Add some coding to the playercontrol script
In varibale=>
Rigidbody2D player;
In start methord=>
player = GetComponent<Rigidbody2D>();
In update methord=>
if (Input.GetButtonDown("Jump")) player.velocity = new Vector2(0, 5f);}
3.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
1.Now You know how to move and flip them animate that player.now i am going to tell you to how to jump the player when pressing spacebar.
2.Add some coding to the playercontrol script
In varibale=>
Rigidbody2D player;
In start methord=>
player = GetComponent<Rigidbody2D>();
In update methord=>
if (Input.GetButtonDown("Jump")) player.velocity = new Vector2(0, 5f);}
2.Add some coding to the playercontrol script
In varibale=>
Rigidbody2D player;
In start methord=>
player = GetComponent<Rigidbody2D>();
In update methord=>
if (Input.GetButtonDown("Jump")) player.velocity = new Vector2(0, 5f);}
3.then start the game.If any error comment me(download script)
Check out this tutorial in this video,
Check out this tutorial in this video,
If is it usefull and you want more videos subscribe my channel subcribe my youtube channnel