如圖所示,我的相機在路徑上移動,我想順利地查看路徑的不同對象。目前我已經嘗試平滑地查看不同的對象
trasnform.LooAt(activePath.gameObject.transform);
但它產生生澀的結果。對象突然看起來對下一個對象挺身而出!如何避免它。我搜索,發現這個解決方案,但它也沒有工作
var targetRotation = Quaternion.LookRotation(activePath.gameObject.transform.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime);
它不工作,而不是急拉不斷 –
嘗試添加乘以Time.deltaTime來減慢移動速度,直到指向你的i ssue。我擔心還有其他腳本會導致問題。您可能需要發佈更多的腳本示例 – Harvey
實際上我使用的是megaShape軟件包,它可以獲取spl格式樣條然後我將我的相機逐一移動到這些樣條線上。更多http://stackoverflow.com/questions/37249480/rotation-toward-the-movement-direction-of-object –