Quantcast
Channel: Questions in topic: "localeulerangles"
Viewing all articles
Browse latest Browse all 106

LocalEulerAngles with random rotation doesn't work

$
0
0
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. Thanks!

Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>