void Awake() { Rigidbody = GetComponent <Rigidbody>(); Collider = GetComponentInChildren <BoxCollider>(); sensor = gameObject.AddComponent <NPCSensor>(); sensor.Vehicle = this; sensor.rayLength = SENSOR_LENGTH; Weight = 200; baseStats = new Vehicle.Stats { TopSpeed = 10f, Acceleration = 5f, AccelerationCurve = 5f, Braking = 10f, ReverseAcceleration = 5f, ReverseSpeed = 5f, Steer = 10f, CoastingDrag = 8f, Grip = 1f, AddedGravity = 1f, Suspension = .2f }; }
void Awake() { player = GameObject.FindGameObjectWithTag(Player.PLAYER_OBJ_NAME).GetComponent <Player>(); Rigidbody = GetComponent <Rigidbody>(); Collider = GetComponentInChildren <BoxCollider>(); sensor = gameObject.AddComponent <NPCSensor>(); sensor.Vehicle = this; sensor.rayLength = SENSOR_LENGTH; Weight = 200; }