Hello! I did a script for a car and before it worked well, now I do not know what happened and it just does not start, it does not turn or anything, what happened? help!
Thank you
using UnityEngine;
using System.Collections;
public class Auto : MonoBehaviour {
public WheelCollider ColliderDI;
public WheelCollider ColliderDD;
public WheelCollider ColliderTI;
public WheelCollider ColliderTD;
public int Aceleracion;
private float DesAceleracion;
public GameObject LucesDeFreno;
void Start ()
{
transform.rigidbody.centerOfMass = new Vector3(0,0,0);
}
void FixedUpdated ()
{
//Aceleracion de el auto
float torque = Aceleracion;
ColliderDI.motorTorque = Input.GetAxis("Vertical") * torque;
ColliderDD.motorTorque = Input.GetAxis("Vertical") * torque;
//Girar las ruedas de el auto
ColliderDI.steerAngle = 15 * Input.GetAxis("Horizontal");
ColliderDD.steerAngle = 15 * Input.GetAxis("Horizontal");
}
}
↧