我是一個絕對的初學者。我目前做的目的是降低景點腳本JavaScript和目標時,我想爲x和y的靈敏度下降到2。我試圖用更改FirstPersonController MouseLook的靈敏度
GetComponent.<UnityStandardAssets.Characters.FirstPerson.MouseLook>().sensitivityX = 2;
,但不起作用。該行的錯誤是
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
AimDownSights.Update() (at Assets/AimDownSights.js:33)
有誰知道如何訪問參考FPSController鼠標外觀下拉,所以我可以改變的敏感性?謝謝!
你得到任何錯誤?你是什麼意思*「它不工作」*? – Programmer
@Programmer我編輯了OP – Orion31