I am getting an error however I do not understand why

image

I am sorry I hope this is theright place to ask

1 Like

Hi @black_MageUK,

Are you using Visual Studio or Visual Studio Code? If the former, check if Visual Studio selected as your External Script Editor in Unity (Edit > Preferences > External Tools)? MonoBehaviour is not coloured cyan. This indicates a problem with VS.

1 Like

Hi!

This means that you have a duplicate script with the name ObjectHit somewhere within your Assets folder. You cannot have two scripts with the same name, delete one to solve the error.

Sorry I am just using visual studio as it said that was fine to use. it turned out as per below I had a duplicate script somehow, I have resolved it and all is working now :slight_smile:

1 Like

THANK YOU! this was driving me crazy :sparkles:

1 Like

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

Privacy & Terms