using UnityEngine;
using System.Collections;
public class CONTROL : MonoBehaviour {
public float walkSpeed;
public float jumpImpulse;
private Rigidbody2D body;
private Vector2 movement;
private float horInput;
// ________________________________________________________________
void Start () {
this.body = this.GetComponent<Rigidbody2D>();
this.movement = new Vector2();
}
// _______________________________________________________________________
void Update () {
this.horInput = Input.GetAxis ("Horizontal");
}
//____________________________________________________________________________
void fixedUpdate(){
this.movement = this.body.velocity;
this.movement.x = horInput * walkSpeed;
this.body.velocity = this.movement;
}
}