So I’m making a hospital horror game and was trying to figure out how to make the flashlight rotate up and down as the player rotates up and down (same x rotation, basically), but the script says that when I try to set the flashlight’s rotational x value (this is in fixed update by the way) equal to the player’s rotational x value, the error given is this:
“Assets/Scripts/FlashlightLook_Y.cs(12,22): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.rotation’. Consider storing the value in a temporary variable”
I don’t know how this works or how to correct the error, so someone please give me some help and tell me how to do this.
Thanks in advance!
Also P.S. maybe we could work together?? IDK it’s just an idea but thanks a ton!!