Quantcast
Channel: Questions in topic: "temporary"
Viewing all articles
Browse latest Browse all 97

Consider storing in temporary variable error when stored in a temporary variable

$
0
0
I am trying to rotate the camera in my game using this code, Vector3 temp = MainCamera.transform.rotation.eulerAngles; temp.x = 50.31731f; temp.y = 90.0f; temp.z = 0.0f; MainCamera.transform.rotation.eulerAngles = temp; (MainCamera is a GameObject) but it comes up with the error message *"Assets/Scripts 2/PlayerController.cs(219,54): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.rotation'. Consider storing the value in a temporary variable"* even though I followed exactly what it showed on other posts and what worked in other instances taking place in the same script.

Viewing all articles
Browse latest Browse all 97

Trending Articles



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