Accessing the Transform/TransformAccess should be done as few times as possible for performance reasons. Instead of reading position and rotation sequentially, you should use GetPositionAndRotation() method.
using UnityEngine;
class Camera : MonoBehaviour
{
void Update()
{
var position = transform.position;
var rotation = transform.rotation;
}
}Fix assignment:
using UnityEngine;
class Camera : MonoBehaviour
{
void Update()
{
transform.GetPositionAndRotation(out var position, out var rotation);
}
}A code fix is offered for this diagnostic to automatically apply this change.