Hi, I have a method in my script which is supposed to rotate by a random number when instantiating. The rotation script goes like this:
newStructure.transform.localEulerAngles.y = (Random.Range (0,360));
And the error I get goes like this:
Assets/GridBehaviour.cs(55,64): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.localEulerAngles'. Consider storing the value in a temporary variable
Do you have any idea how I would solve this? Some Google results said that you have to have all Vector3 proprieties, but since this doesn’t use Vector3 I think those are just to fool me.