Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Phlexi · Nov 03, 2016 at 03:50 AM · uiguierror

I need help with error code: CS0234

Hi! I'm following a tutorial (at 5:45 to 7:46) at a game example. Right now im doing the UI. In my version of unity there dosen't seem be an element/object called UI in the heirarchy, but there is one called GUI and they seem to be/look alike.

My Code:

 using UnityEngine;
 using UnityEngine.UI;
 using System.Collections;
 
 public class Boll_kontroll : MonoBehaviour {
 
     public float speed;
     public Text countText;
 
     private Rigidbody rb; 
     private int count;
 
     void Start ()
     {
                 rb = GetComponent<Rigidbody> ();
             count = 0;
             SetCountText ();
         }
 
     void FixedUpdate ()
     {
                 float moveHorizontal = Input.GetAxis ("Horizontal");
                 float moveVertical = Input.GetAxis ("Vertical");
 
                 Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical); 
 
                 rb.AddForce (movement * speed);
         }
 
     void OnTriggerEnter(Collider other) 
     {
                 if (other.gameObject.CompareTag ("Pick Up")) {
                         other.gameObject.SetActive (false);
                             count = count + 1;
                             SetCountText ();
                 }
         }
     
     void SetCountText ()
     {
     countText.text = "count: " + count.ToString ();
         }
 
 }

Im getting the error code at the second line in the code, "using UnityEngine.UI;". It says "The type or namespace name 'UI' does not exist in the namespace 'UnitityEngine'".

I have tried to replace the '.Ui' in 'UnityEngine' with '.GUI' because i use GUI instead of Ui, that didn't work.

Thanks in before hand and sorry for my broken english.

Comment
Add comment · Show 1
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 Landern · Nov 03, 2016 at 03:40 PM 0
Share

What version of Unity are you using?

If you're using a version prior to 4.6 the Namespace UnityEngine.UI didn't exist whatsoever, the old system which relied on the OnGUI method was what was in place, that has been deprecated and replaced with the UnityEngine.UI namespace and a completely different methodology of UI development within the Editor.

If you're using less than 4.6, you can not "FIX" this error unless you update your version of unity to a supporting version.

1 Reply

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

Answer by Cynikal · Nov 03, 2016 at 12:01 PM

This is a bug. FYI: UI is correct. Not GUI.

You can try: Right Clicking in your Project Folder View, and Reimport All.

You can also (depending on what IDE you're using (MonoDevelop or VS)) you can Sync the project, or delete the "Library" folder from your MAIN Project folder (Up a level from your Assets folder) and let it rebuild.

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

141 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 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

UI buttons are invisible but clickable when built 0 Answers

Stack Overflow Error: I can't figure out why it is happening,Stack Overflow Error. Can't figure out why it is happening. 1 Answer

Canvas not filling up the whole screen in Unity 5 0 Answers

Unity UI create and drag with one click 0 Answers

Coroutine [sometimes] stops working 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