I am an absolute beginner. I am currently making an aim down sights script with javascript, and when aiming I want the sensitivity for both x and y to drop to 2. I tried using
GetComponent.<UnityStandardAssets.Characters.FirstPerson.MouseLook>().sensitivityX = 2;
but that doesn't work. The error for that line is
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)
Does anyone know how to access the reference the Mouse Look dropdown in FPSController so I can change sensitivity? Thanks!