Fiz deu tudo certo, só que na parte que fica uma leve tremida, a minha permanece. Não sei o que pode ser!!!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ControleJogador : MonoBehaviour
{
public float velocidade = 10 ;
Vector3 direcao;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float eixox = Input.GetAxis ("Horizontal");
float eixoz = Input.GetAxis("Vertical");
Vector3 direcao = new Vector3(eixox, 0 , eixoz);
GetComponent < Rigidbody > ().MovePosition
(GetComponent < Rigidbody >().position + (direcao * 10 * Time.deltaTime));
if(direcao != Vector3.zero)
{
GetComponent <Animator> ().SetBool ("Movendo", true);
}
else
{
GetComponent <Animator> ().SetBool ("Movendo", false);
}
}
void FixUpdate ()
{
GetComponent < Rigidbody > ().MovePosition
(GetComponent < Rigidbody >().position + (direcao * 10 * Time.deltaTime));
}
}