【发布时间】:2014-08-26 10:34:16
【问题描述】:
这是我得到的错误:
Assets/Scripts/CameraScript.cs(60,39):错误 CS1612:无法修改“UnityEngine.Transform.position”的值类型返回值。考虑将值存储在临时变量中
这是我的代码:
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);
}
}
【问题讨论】: