Good evening, i have been using unity3d 2018.1 for quite a while, because of incompatibility issues with some addons i upgraded to 2018.3.
Now i using a list of vector3 and changing its individual axis with a for statement but im being displayed the following error:
Assets\3DPrinting\servoArmController.cs(28,5): error CS1612: Cannot modify the return value of ‘List.this[int]’ because it is not a variable
Here is the abbreviated code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class servoArmController : MonoBehaviour {
public List<GameObject> servo;
public List<Vector3> servosAdjust;
// Start is called before the first frame update
void Start() {
}
// Update is called once per frame
void Update(){
baselimitRotation();
}
void baselimitRotation(){
for (int i = 0; i < servosAdjust.Count; i++){
if (servosAdjust_.x > 360f || servosAdjust*.x < -360f){*_
_ servosAdjust*.x = 0f;
}
if (servosAdjust.y > 360 || servosAdjust.y < -360){
servosAdjust.y = 0f;
}
if (servosAdjust.z > 360 || servosAdjust.z < -360){
servosAdjust.z = 0f;
}
}
}*_
}