This is the error I am getting:
Assets/Scripts/CameraScript.cs(60,39): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position'. Consider storing the value in a temporary variable
This is my code:
void Start (){
thisTransform = transform;
// Disable screen dimming
Screen.sleepTimeout = 0;
}
void Update (){
//Reset playerscore
playerScore = settings.playerScore;
//Smooth follow player character
if (target.position.y > thisTransform.position.y) {
thisTransform.position.y = Mathf.SmoothDamp( thisTransform.position.y,
target.position.y, ref velocity.y, smoothTime);
}
}