Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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 Tritonmosquito · Jan 18, 2018 at 12:06 AM · namespacetypenot found

Types and namespace not found...

Ok, so I'm new to Unity and C# but I wrote a tiny script which runs without a problem inside Unity. But when I try to export it (build) I get a bunch of errors all telling me types are not found, and it's pretty much all the types I used... So it doesn't find MonoBehaviour, Vector3 or Transform.

The script looks like this :

  • using System.Collections.Generic; using UnityEngine; public class CameraBehaviour : MonoBehaviour { Vector3 myVectorZ; Vector3 myVectorY; Vector3 myVectorX; Transform myTransform; void Awake () {

        myTransform = GetComponent<Transform> ();
             
         myVectorZ = new Vector3 (myTransform.position.x, myTransform.position.y, myTransform.position.z+2);
         myVectorY = new Vector3 (myTransform.position.x, myTransform.position.y+2, myTransform.position.z);
         myVectorX = new Vector3 (myTransform.position.x+2, myTransform.position.y, myTransform.position.z);
     }
     // Use this for initialization
     void Start () {
         
     }
     
     // Update is called once per frame
     void FixedUpdate () {
         if ( Input.GetKey( "space" ) )
         { transform.Translate( myVectorZ , Space.Self);
             Debug.Log ("Fixed :");
             Debug.Log (myTransform.position.z); }
     }
     void Update () {
         if ( Input.GetKey( "space" ) )
         { transform.Translate( myVectorZ , Space.Self);
             Debug.Log ("NotFixed :");
             Debug.Log (myTransform.position.z); }
     }
    

} *

I'm guessing I didn't think of a simple thing that ruin everything but I didn't find an answer fitting my problem. Sorry if I'm not clear, not english... Thanks in advance for your answers !

Comment
Add comment · Show 2
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 Buckslice · Jan 18, 2018 at 12:04 AM 1
Share

I imported your code into Unity and it works fine. $$anonymous$$ake sure you are building within Unity and not through Visual Studio or something else.

avatar image Bunny83 Buckslice · Jan 18, 2018 at 01:42 AM 0
Share

Right, also it would be interesting what target platform you're building for and when you actually get errors, please copy them from the console and include them in the question.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Tritonmosquito · Jan 18, 2018 at 08:23 AM

Actually I managed to finally fix it !

I was having errors when trying to export for windows only, I succeeded to build for Html5, but when I tried the windows thing I kept getting errors like "The type or namespace name XXX could not be found (are you missing using directive or an assembly reference?)" for every type I put in the code.

The problem came from the Facebook exporting module for some reason, I got rid of it directly in the Plugin folder and now I can build for Windows.

Absolutely no idea why it's connected though :/

Thanks for your answers and if you have a way to reinstall the facebook module without getting this error again ! :)

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.

Follow this Question

Answers Answers and Comments

75 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How I can fix This? HELP ME! 0 Answers

The type or namespace name `GridSelection' could not be found. Are you missing a using directive or an assembly reference? 1 Answer

The type or namespace 'blabla' could not be found 1 Answer

StartCoroutine namespace or type not found 2 Answers

Name GUI input help in C# 0 Answers


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