- Home /
Question by
RLin · Jul 07, 2015 at 03:17 PM ·
errorwheelcollidertransform.rotatenan
Transform.rotate returns NAN error.
I am developing a racing game with wheelcolliders, and every visual wheel mesh has the script below attached. It was working several days ago, however, it now returns a NAN error. One thing that is worth stating is that of the 8 cars in my scene, only 6 output the error. The other two have the exact same script, but run without errors. Here is the script:
using UnityEngine;
using System.Collections;
public class wheelrotate : MonoBehaviour {
public Transform wheel;
public Transform parent;
public WheelCollider col;
// Update is called once per frame
void Update () {
wheel.Rotate (col.rpm * 6f * Time.deltaTime, 0, 0);
parent.transform.localEulerAngles = new Vector3 (0, col.steerAngle,0);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220611230210im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Continual position error 0 Answers
SceneCamera NAN persisting problem 2 Answers
Rotate Issue 0 Answers
runtime nullreferenceexception in Wheelcollider..? 1 Answer
suddenly have 'nan, nan, nan' error 2 Answers