• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by jordan1998 · Sep 24, 2012 at 02:00 PM · beginnernamespacesyntax

the type or namespace name Note could not be found. are you missing a using directive or an assembly reference.

"the type or namespace name Note could not be found. are you missing a using directive or an assembly reference."

i am trying to make a pickup page script and i keep getting an error witch says the type or namespace name Note could not be found. are you missing a using directive or an assembly reference. i have tried everything but i cant seem to get it to work. here is my script


 using UnityEngine;
 using System.Collections;
 
 public class PickupNote : MonoBehaviour {
     
     //Maximum Distance you Can Pick Up A Book
     public float maxDistance = 1.5F;
     
     //Your Custom GUI Skin with the Margins, Padding, Align, And Texture all up to you :)
     private GUISkin mySkin;
     
     //Are we currently reading a note?
     private bool readingNote = false;
     
     //The text of the note we last read
     private string noteText;
     
     
     void Start () {
         
         //Start the input check loop
         StartCoroutine ( CheckForInput () );
         
     }
     
     private IEnumerator CheckForInput () {
         
         //Keep Updating
         while (true) {
         
             //If the 'E' was pressed and not reading a note check for a note, else stop reading
             if (Input.GetKeyDown (KeyCode.E)) {
                 
                 if (!readingNote)
                     CheckForNote ();
                 else 
                     readingNote = false;
             
             }
                 
             //Wait One Frame Before Continuing Loop
             yield return null;
             
         }
         
     }
     
     private void CheckForNote () {
         
         //A ray from the center of the screen
         Ray ray = Camera.mainCamera.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0));
         RaycastHit data;
         
         //Did we hit something?
         if (Physics.Raycast (ray, out data, maxDistance)) {
             
             //Was the object we hit a note?
             if (data.transform.name == "Note") {
                 
                 //Get text of note, destroy the note, and set reading to true
                 noteText = data.transform.GetComponent <Note> ().Text;
                 mySkin = data.transform.GetComponent <Note> ().mycustomSkin;
                 Destroy (data.transform.gameObject);
                 readingNote = true;
                 
             }
             
         }
         
     }
     
     void OnGUI () {
         
         if (mySkin)
             GUI.skin = mySkin;
         
         //Are we reading a note? If so draw it.
         if (readingNote) {
             
             //Draw the note on screen, Set And Change the GUI Style To Make the Text Appear The Way you Like (Even on an image background like paper)
             GUI.Box (new Rect (Screen.width / 4F, Screen.height / 16F, Screen.width / 2F, Screen.height * 0.75F), noteText);
             
         }
         
     }
     
 }
 
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image whydoidoit · Sep 24, 2012 at 02:37 PM 0
Share

You are doing GetComponent&ltlNote> this presumes you have a script called Note - do you?

avatar image jordan1998 · Sep 25, 2012 at 02:38 AM 0
Share

no i dont no what the problem is

avatar image justinl · Sep 28, 2012 at 07:13 AM 0
Share

what line of code does that error occur on? Without knowing that it's very difficult to help you figure ito ut.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Basic javascript array declaration 2 Answers

Greater than and less than syntax problem 1 Answer

How can I make a timer follow the format 00:00 (Minutes, Seconds) 2 Answers

First Person Controller. (Unity3) 1 Answer

Starting Unity/Programming from scratch 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges