ObjectHit script suddenly has two errors after Unity update

After updating Unity, I began working on the Time.time course, only to be unable to run the game because of 2 errors that had popped up in the ObjectHit script that weren’t there before; it ran just fine beforehand.



Not sure how to fix this.

At a guess, you have two ObjectHit classes. It could even be in another file with a different name. It might also be some sort of compiler issue. Perhaps delete the Library and Obj directories in your project directory to force a recompile when you next load Unity.

On a side note, it’s not a good idea to use an updated Unity for an existing project without a good reason.

So apparently there was another ObjectHit file in a different directory, and deleting it seems to have solved the issue. At some point in the course, Rick had us move the scripts into their own folder. Maybe somehow it duplicated instead of just going into the folder.

Thanks for the help!

Glad my guess paid off.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms