In my unity car game project, I have four car(one player car) with respective four indicators (one main Indicator). Indicator moves vertically upward on update function and each indicator move with random speed. In case of car, player car does not move upward and downward, it only moves left and right by the user. Similarly other car also does not move left,right,forward,backward. Rather the other car shows forward and backward move animation with the difference between the indicators(there are four indicator, indicators means three indicator that references three cars other than player car) and main indicator position(main indicator is reference for player car).
I have two scene, one for user interface( that contain play button,exit button etc.). And another scene for game play.
When I click on Play Game button then it goes to game scene and the racing game start with no error. After the completion of game, user interface scene loads automatically saying "Replay Game", "Exit Game". In this case if I click on "Replay Game" button, the game scene opens and indicator start to move but the car does not move( does not show animation) with respect to the movement of indicator. And the error occur here saying
Missing Reference Exception: The object of type moveCar(it is script attached to the car object) has been destroyed but you are still trying to access it.Your script should either check if it is null or you should not destroy the object.
During the error, I check the game object car and it contains movecar script but there is still same error. As the script is working fine on first step so I did not have attach code here. Any help would be greatly appreciated. I am getting stop in this problem for many days.