• 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 rocksean30 · Sep 29, 2011 at 11:37 AM · javascripterrortransform

The name 'Transform' does not denote a valid type ('not found'). Did you mean 'System.Net.Mime.TransferEncoding'? (BCE0018)

Hi all, I am new to game development, I am learning unity from http://www.vtc.com and when i came to scripting part it started giving me errors error image

D:\My Unity Projects\Tuts\Assets\Standard Assets\Character Controllers\Sources\Scripts\CharacterMotor.js(1,1): Error BCE0021: Namespace 'UnityEditor' not found, maybe you forgot to add an assembly reference? (BCE0021) (Assembly-UnityScript-firstpass) D:\My Unity Projects\Tuts\Assets\Scripts\Respawn.js(13,13): Error BCE0005: Unknown identifier: 'Transform'. (BCE0005) (Respawn)

I never touched CharacterMotor.js but i started giving errors, and in my script respawn the I am not able to use Transform. Please help me.

edit(copied from comment)

It's a simple script:

function Update ()
{
    if (Transform.Position.y < -10)
    {
        print(Transform.Position.y);
    }
    if (Transform.Position.y < -20)
    {
        Transform.Position.x = 0;
        Transform.Position.y = 2; 
        Transform.Position.z = 0; 
    }
}

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by syclamoth · Sep 29, 2011 at 01:22 PM

You need to put any scripts w$$anonymous$$ch use the UnityEditor namespace inside a subfolder called 'Editor'. T$$anonymous$$s tells Unity that those scripts are edtior-only and not to include them in the build! It also lets the compiler know that the editor namespace exists.

Comment
Add comment · Show 4 · 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 rocksean30 · Sep 29, 2011 at 04:08 PM 0
Share
avatar image Bunny83 · Oct 01, 2011 at 11:52 AM 2
Share
avatar image rocksean30 · Oct 01, 2011 at 02:45 PM 0
Share
avatar image rocksean30 · Oct 01, 2011 at 03:55 PM 0
Share
avatar image
0

Answer by dai1741 · Oct 01, 2011 at 11:21 AM

The 'UnityEditor' namespace error may be a bug of Unity 3.4.1f5. Many people have reported it (See unity 3.4.1f5 namespace error - Unity Answers).
Despite the errors being given in MonoDevelop, Unity can compile the scripts successfully. So, just ignore them :)

The Transform error seems to be caused because there's somet$$anonymous$$ng wrong with your script 'Respawn.js', but I'm not sure about it.

Comment
Add comment · Show 2 · 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 rocksean30 · Oct 01, 2011 at 02:44 PM 0
Share
avatar image dai1741 · Oct 02, 2011 at 11:52 AM 0
Share
avatar image
0

Answer by Bunny83 · Oct 01, 2011 at 04:16 PM

Transform is a type! You can't use a type like a variable. To access the Transform component of your GameObject you have to use transform (notice the lower-case "t" ) instead of Transform.

Also the .position property have to be lower-case.

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

BCE0019: 'Add' is not a member of 'UnityEngine.Transform[]' 1 Answer

Error: not a member of 'UnityEngine.GameObject[]'. 2 Answers

Setting Scroll View Width GUILayout 1 Answer

Can someone help me fix my Javascript for Flickering Light? 6 Answers

I can't script enemy animation 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