rb.AddForce (moveVec.normalized* moveForce) нормализован? Может нужно что-то в физике проекта исправить?
Синтаксис:
Используется csharp
using UnityStandardAssets.CrossPlatformInput;
void FixedUpdate () {
Vector3 moveVec = new Vector3(CrossPlatformInputManager.GetAxis ("Horizontal"), CrossPlatformInputManager.GetAxis ("Vertical"),4096) ;
if (moveVec.x != 0 && moveVec.y != 0)
targetRotation = Quaternion.LookRotation (moveVec.normalized, Vector3.back.normalized);
transform.rotation= Quaternion.Slerp (transform.rotation, targetRotation, rotationForce * Time.deltaTime);
rb.AddForce (moveVec.normalized* moveForce);
}
void FixedUpdate () {
Vector3 moveVec = new Vector3(CrossPlatformInputManager.GetAxis ("Horizontal"), CrossPlatformInputManager.GetAxis ("Vertical"),4096) ;
if (moveVec.x != 0 && moveVec.y != 0)
targetRotation = Quaternion.LookRotation (moveVec.normalized, Vector3.back.normalized);
transform.rotation= Quaternion.Slerp (transform.rotation, targetRotation, rotationForce * Time.deltaTime);
rb.AddForce (moveVec.normalized* moveForce);
}