using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Player_Control: MonoBehaviour {

	public float speed ;
	public float gravity;//custom cravity
	Vector3 movement;

	private Rigidbody rb ;

	void Start ()
	{
		rb = GetComponent<Rigidbody> ();
	}

	void FixedUpdate ()
	{
        //transform.position = transform.position; 

		float moveHorizontal = Input.GetAxisRaw ("Horizontal");
		float moveVertical = Input.GetAxisRaw ("Vertical");

        Debug.Log(moveHorizontal);
        Debug.Log(moveVertical);

        move (moveHorizontal, moveVertical);

	}

	void move (float moveHorizontal, float moveVertical)
	{
		movement.Set (moveVertical, -gravity, -moveHorizontal);
		movement = movement.normalized * speed * Time.deltaTime;


		rb.MovePosition (transform.position + movement);
		transform.rotation = Quaternion.Euler (-90, 0, 0);
		//transform.LookAt(transform.position + movement);
	}

    void dash()
    {

    }
		
}
