here is the script
using UnityEngine;
[RequireComponent(typeof(playermotor))]
public class playercontroller : MonoBehaviour {
[SerializeField]
private float speed = 5f;
private playermotor motor;
void start()
{
motor = GetComponent<playermotor> ();
}
void update ()
{
// calculate movemment speed as 3d vector
float _xmov = Input.GetAxisRaw ("horizontal");
float _zmov = Input.GetAxisRaw ("vertical");
Vector3 _movhorizontal = transform.right * _xmov;
Vector3 _movvertical = transform.forward * _zmov;
// final movement vector
Vector3 _velocity = (_movhorizontal + _movvertical).Normalize * speed;
//apply movement
motor.move (_velocity);
}
}