In this video, we will discuss how to restrict our player's movements through the X-axis in the game view. we will use a combination of if-else statements along with transform. position to achieve our results. Also, we will try to optimize the code that we wrote in the earlier video by using Mathf.Clamp Function.
VID13# Restricting Player's Movement in The X-Axis | Unity Tutorial In Hindi