Hi, I have a problem with using the eulerAngles: I have this Script: Code (CSharp): rotation.x += -Input.GetAxis("Mouse Y") * 10f; rotation.x = Mathf.Clamp(rotation.x, -89f, 50f); Cam.eulerAngles.x = rotation.x; And this Error: Assets/Scripts/Move.cs(35,29): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.eulerAngles'. Consider storing the value in a temporary variable Would be awesome if you could help me! ~glemau
Assign complete rotation to Cam.eulerAngles, not individual components. Code (csharp): Vector3 rotation = Cam.eulerAngles; rotation.x += -Input.GetAxis("Mouse Y") * 10f; rotation.x = Mathf.Clamp(rotation.x, -89f, 50f); Cam.eulerAngles = rotation;