- Home /
The question is answered, right answer was accepted
object reference not set to an instance of an object Car.Carcontoller.CapSpeed()
i try to fix it 2 in row but i'm very confusing i'm new in unity please help me
i try to comment capSpeed() method but it don't show any error then my car doesn't drive i try to print value before method call but it's has value it's not null
error message
NullReferenceException: Object reference not set to an instance of an object UnityStandardAssets.Vehicles.Car.CarController.CapSpeed () (at Assets/CarAssets/Vehicles/Car/Scripts/CarController.cs:198) UnityStandardAssets.Vehicles.Car.CarController.Move (Single steering, Single accel, Single footbrake, Single handbrake) (at Assets/CarAssets/Vehicles/Car/Scripts/CarController.cs:175) CarUserControl.UpdateNet () (at Assets/CarAssets/Vehicles/Car/Scripts/CarUserControl.cs:185) CarUserControl.FixedUpdate () (at Assets/CarAssets/Vehicles/Car/Scripts/CarUserControl.cs:82)
error line: 82 CarUserController.cs
error line 185 in UpdateNet() method CarUserController.cs
error line 175 in Move method Carcontroller.cs
error line 198 in CapSpeed method CarController.cs
vdo error link: https://streamable.com/b24z0
thanks you for you answer