In this tutorial We want to see how to flip 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.Its not much harder
Before enter this tutorial you want to see
- How to move Player here.
1.You know how to move the player.now i am going to tell you to how to flip the player while moving.
2.in previous post i created a script called playercontroller.cs Insert these thing in update methord of that script .
=> Vector3 playerscale = transform.localScale;
if(Input.GetAxis("Horizontal")<0 && playerscale.x > 0)
{playerscale.x *= -1;}
if (Input.GetAxis("Horizontal") > 0 && playerscale.x < 0)
{playerscale.x *= -1;}
transform.localScale = playerscale;
8.then start the game.If any error comment me(download script)
Checkout 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 move player in this link here
you can watch how to animate moving player in this link here
Next tutorial,
unity 2d tutorial-2:how to animate move the player in platform 2d game unity engine with easy c# codings
Watch tutorial to download Unity Engine here