In this tutorial We want to see how to move 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
1.create new 2d project as you wish in unity
2.import asset that you want by dragging them into the project section (like background,player image etc... you can download here)
3.first drag the player image into scene view and resize it .then add component "rigidbody 2d" and "box collider" in the inspecter section
4.and also drag the background image and then change soring layer to -1 add component "edge collider " then make that at the ground for player collided and be on the ground
5.then create a new c# script as "playercontrol"
6.In this script type this in the update methord,
=>transform.Translate(Input.GetAxis("Horizontal") * 5f * Time.deltaTime, 0, 0);
8.then start the game.If any error comment me
Checkout it out this tutorial in this video
If is it usefull and you want more videos subscribe my channel subcribe my channnel
⦁ you can watch how to flip moving player in this video here
Next tutorial,
unity 2d tutorial-2:how to flip move the player in platform 2d game unity engine with easy c# codings
Watch tutorial to download Unity Engine here