protected override void Update()
{
base.Update();
if (myNetworkView.isMine && !IsDying)
{
// If the player is too far to the left on the screen, they shouldn't be able to move back
if (myTransform.position.x < MinimumScreenX)
{
myTransform.position = new Vector3(MinimumScreenX, myTransform.position.y, myTransform.position.z);
}
// Players should not be able to walk past the level boss
else if (myTransform.position.x > MaximumScreenX)
{
myTransform.position = new Vector3(MaximumScreenX, myTransform.position.y, myTransform.position.z);
}
}
}