using System.Collections;
using System.Collections.Generic;
public class movement : MonoBehaviour {
public float walkSpeed = 1.0f;
public float wallLeft = 0.0f;
public float wallRight = 5.0f;
float walkingDirection = -1.0f;
wallLeft = transform.position.x -0.3f;
wallRight = transform.position.x +2.7f;
walkAmount.x = walkingDirection * walkSpeed * Time.deltaTime;
if ( transform.position.x >= wallRight)
transform.rotation = Quaternion.Euler(new Vector3(0,0,0));
walkingDirection = -1.0f;
else if ( transform.position.x <= wallLeft)
transform.rotation = Quaternion.Euler(new Vector3(0, 180, 0));
walkingDirection = -1.0f;
transform.Translate(walkAmount);