To make your character constantly move you can apply a constant velocity or position update on each Update, the below is very crude but will get you started:
float movementSpeed = 5f;
void Update(){
oPos = transform.position;
transform.position = new Vector3(oPos.x + movementSpeed, oPos.y, oPos.z)
}
Altogether:
public class RunningCharacter : MonoBehaviour {
float movementSpeed = 5f;
bool runForwards = true;
void Update(){
UpdatePosition();
}
void UpdatePosition(){
Vector3 oPos = transform.position;
float calculatedPosition;
if(runForwards){
calculatedPosition = oPos.x + movementSpeed;
} else {
calculatedPosition = oPos.x - movementSpeed;
}
transform.position = new Vector3(oPos.x + movementSpeed, oPos.y, oPos.z)
}
void OnCollsionEnter(Collider collider){
WallCollisionHandler(collider);
}
void WallCollsionHandler(Collider collider){
if(collider.tag == "Left Facing Wall")
{
runForwards = false;
// Or
// JumpBackwards()
}
else if(collider.tag == "Right Facing Wall")
{
runForwards = true;
// Or
// JumpForwards()
}
}
}
