0

I've found a script and am trying to add the script to an empty game object in Unity3D.

From what I've read on stack & the documentation,

"The class name and file name must be the same to enable the script component to be attached to a GameObject"

As far as I can tell, the script name, game object name and public class within the script file are all named "VRDraw" (see screenshot).

Does anyone know what I am doing wrong here? (I've also tried deleting and re-creating the scripts/game objects with the proper name from the start, but this didn't work unfortunately)

Also, I can't find OVRAvatarLogger anywhere in the script. Does anyone know where this comes from?

error message unity

2
  • Your script wasn't (re)compiled yet due to the compiler error you get. So for Unity your component doesn't exist yet. Commented Jan 27, 2020 at 14:15
  • I know late but the class is actually called AvatarLogger .. seems to be a naming mistake by the author of your asset. Commented Jul 29, 2020 at 6:51

2 Answers 2

1

you have another error in your script, fix all errors in your script and unity will recompile all files, so you can add your script to game object error

Sign up to request clarification or add additional context in comments.

Comments

1

If you notice the red letter on the bottom of the Unity app, you can see a compilation/syntax error, regarding the namespace "Enums". This might prohibit the IDE from continuing to "work" on your script and attaching it, since it does not pass the syntax check.

Make sure you resolve the reference error first, and then try to re-compile and "play"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.