Hi guys a bit of late night scripting here and I’m getting
error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
for line 45, no idea why.
using UnityEngine;
using System.Collections;
public class CivilMiner01 : MonoBehaviour {
public GameObject DrillOnine;
public GameObject target;
public GameObject[] Targets;
private int index;
private float dist;
private int ShipSpeed = 8;
public bool impulse = true;
private int CargoCapasity = 10000;
private int CurrentCapasity = 0;
public GameObject Target2;
private bool HomeBound = false;
public float rotationSpeed = 12f;
void Start () {
Targets = GameObject.FindGameObjectsWithTag ("Asteroid");
index = Random.Range (0, Targets.Length);
target = Targets [index];
}
// Update is called once per frame
void Update () {
// Use
if(impulse = true){
dist = Vector3.Distance (target.transform.position, transform.position);
transform.rotation = Quaternion.Slerp(target.transform.rotation, Quaternion.LookRotation(target.transform.position - transform.position ), Time.deltaTime * rotationSpeed);
}
if(dist < 100){ DrillOnine.SetActive = true;
CurrentCapasity += 0.01f * Time.Deltatime;
impulse = false;
}
if(CurrentCapasity == CargoCapasity){
DrillOnine.SetAcrive = false;
impulse = true;
HomeBound = true;
}
if(target = null){
Targets = GameObject.FindGameObjectsWithTag ("Asteroid");
index = Random.Range (0, Targets.Length);
target = Targets [index];
}
if (HomeBound = true) {
Targets = GameObject.FindGameObjectsWithTag ("StationCeres");
index = Random.Range (0, Targets.Length);
target = Targets [index];
}
}
}