• 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 /
  • Help Room /
avatar image
0
Question by PaxStyle · Oct 28, 2015 at 01:22 PM · scripting problemtypevalid

The name Passi does not denote a valid type (not found).

Hi to all, I don't understand this error.. Before I have never had this problem.. but today I've changed the script 'Passi' with another one.. And I get this error.. Someone can tell me why?

 #pragma strict
 
 private var showingCursor = false;
 var scriptToControl : MouseLook;
 var scriptToControl1 : CharacterMotor;
 var scriptToControl2 : Passi;
 
 
 
 function Start ()
 {
 Screen.showCursor = false;
 showingCursor = false;
 
 
 scriptToControl = GetComponent("MouseLook");
 scriptToControl1 = GetComponent("CharacterMotor");
 scriptToControl2 = GetComponent("Passi");
 }
 
 
 
 
 
 
 function Update () {
 
 if(Input.GetMouseButtonDown(1)){
 
 
 if(showingCursor == true){
 
 Screen.showCursor = false;
 showingCursor = false;
 
 
 }
 
 else if(showingCursor == false){
 
 Screen.showCursor = true;
 showingCursor = true;
 
 }
 
 
 //inizio disattivare script
 if (scriptToControl.enabled)
 scriptToControl.enabled = false;
 else
 scriptToControl.enabled = true;
 //inizio disattivare script1
 if (scriptToControl1.enabled)
 scriptToControl1.enabled = false;
 else
 scriptToControl1.enabled = true;
 //inizio disattivare script2
 if (scriptToControl2.enabled)
 scriptToControl2.enabled = false;
 else
 scriptToControl2.enabled = true;
 //fine disattivare script
 
 
 
 
 }
 }

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 PaxStyle · Oct 29, 2015 at 11:17 AM 0
Share

$$anonymous$$aybe I have to convert the C# passi into a JS to make it work correcly in this script?

avatar image centaurianmudpig · Oct 29, 2015 at 12:07 PM 0
Share

C# uses classes. If you changed the file name of the C# script you also need to change the name of the class to be the same.

avatar image PaxStyle centaurianmudpig · Oct 29, 2015 at 01:43 PM 0
Share

But the C# script has already the name 'Passi', but I get that error.. why?

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Statement · Oct 29, 2015 at 01:49 PM

See Special Folders and Script Compilation Order in the manual.

A common example is where a UnityScript file needs to reference a class defined in a C# file. You can achieve this by placing the C# file inside a Plugins folder and the UnityScript file in a non-special folder. If you don’t do this, you will get an error saying the C# class cannot be found.

Comment
Add comment · Show 1 · Share
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 Statement · Oct 29, 2015 at 01:52 PM 0
Share

Alternatively, since you don't seem to need the interface of Passi (at least not in that context), you could remove the dependency to the type and use $$anonymous$$onoBehaviour ins$$anonymous$$d.

 var scriptToControl2 : Passi;

Changes to

 var scriptToControl2 : $$anonymous$$onoBehaviour;

Note that you'll have to drag the actual script from the object into the public field in the inspector because it'll otherwise use whatever first $$anonymous$$onoBehaviour (script) exist on the other game object.

avatar image
0

Answer by centaurianmudpig · Oct 29, 2015 at 02:02 PM

A similar question was answered here: http://answers.unity3d.com/questions/667293/does-not-denote-a-valid-type-not-found.html

Comment
Add comment · Share
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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Convert to 128 bit to 16 bit and scripting errors 0 Answers

Player keeps flying up 0 Answers

Anyone knows why i'm getting this massive bug? 0 Answers

Object reference not set to an instance of an object 0 Answers

Vector3.Lerp in update, how stop? 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