Hei im created a game cars with unity 3d free version and show this
UnassignedRefecenceException: The variable RoataSD of ControlMasina has not
been assigned
You probably need to assign the RoataSD variable of the ControlMasina script in the inspector. ControlMasina.FixedUpdate () (at Assets/Scripturi/ControlMasina.js:14)
And Script is this:
#pragma strict
var RoataFD : WheelCollider;
var RoataFS : WheelCollider;
var RoataSD : WheelCollider;
var RoataSS : WheelCollider;
var maxTorque : float = 50;
function Start ()
{
rigidbody.centerOfMass.y = -0.9;
}
function FixedUpdate ()
{
RoataSD.motorTorque = maxTorque * Input.GetAxis("Vertical");
RoataSS.motorTorque = maxTorque * Input.GetAxis("Vertical");
RoataFD.steerAngle = 10 * Input.GetAxis("Horizontal");
RoataFS.steerAngle = 10 * Input.GetAxis("Horizontal");
}
↧