• 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 blueocean0 · Feb 28, 2020 at 12:35 PM · namespace

Hello there I am getting 'the type or namespace 'Controller' could not be found (are you missing an assembly reference?'

I am using Unity 2019.3 and also cannot find the script when I assign it to a character. I saw using System.Web.Mvc can fix it but it cannot find the package to install it. Any help what should I do? and What to learn for future similar issues? Like learning about libraries, packages... Thanks

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 blueocean0 · Feb 29, 2020 at 12:20 AM 0
Share

I think I found the problem. The different version of unity used in the tutorial make compiling errors. So I guess I have to be updated with the changes. And do my own code :)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by tormentoarmagedoom · Feb 28, 2020 at 12:36 PM

Hello.

First, if rpetend someone tyo understand your problem, post your code.

Second, You are using controller.something and Controller does not exist in your scripts.

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

Answer by blueocean0 · Feb 28, 2020 at 11:58 PM

Also here is the video

https://www.youtube.com/watch?v=0jzc_uNdH40&list=PLA6Gf0nq2Gh4YGSGCX9kj7v5-ruTU87qS∈dex=8&t=0s

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 blueocean0 · Feb 28, 2020 at 11:59 PM 0
Share

$$anonymous$$y code

using UnityEngine;

public class placeBrick : $$anonymous$$onoBehaviour { public Brick PrefabBrick; public $$anonymous$$aterial Transparent$$anonymous$$at; public $$anonymous$$aterial Brick$$anonymous$$at;

 public Vector3 Debug;

 private Controller Controller;
 protected Brick CurrentBrick;
 protected bool PositionOk;
 void Awake()
 {
     Controller = GetComponent<Controller>();
 }
 // Start is called before the first frame update
 void Start()
 {
     SetNextBrick();
 }

 // Update is called once per frame
 void Update()
 {
     if (CurrentBrick != null)
     {
         if(Physics.Raycast(Camera.main.transform.position + Vector3.up * 0.1f * Controller.CameraDistance, Camera.main.transform.forward, out var hitInfo, float.$$anonymous$$axValue, LegoLogic.Layer$$anonymous$$askLego))
         {
             var position = LegoLogic.SnapToGrid(hitInfo.point);
             var placePosition = position;
             PositionOk = false;
             for (int i =0; i < 10; i++)
             {
                 var collider = Physics.OverlapBox(placePosition + CurrentBrick.transform.rotation * CurrentBrick.GetComponent<Collider>().center, CurrentBrick.Collider.size / 2, CurrentBrick.transform.rotation, LegoLogic.Layer$$anonymous$$askLego);
                 PositionOk = collider.Length == 0;
                 if (PositionOk)
                     break;
                 else
                     placePosition.y += LegoLogic.Grid.y;
             }
             if (PositionOk)
                 CurrentBrick.transform.position = placePosition;
             else
                 CurrentBrick.transform.position = position;
         }
     }
     
 }
 public void SetNextBrick()
 {
     CurrentBrick = Instantiate(PrefabBrick);
     CurrentBrick.Collider.enabled = false;
     CurrentBrick.Set$$anonymous$$aterial(Transparent$$anonymous$$at);
 }

}

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

121 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

Related Questions

C# Visual Basic Error 1 Answer

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

Missing namespaces with A* Pathfinder Pro 2 Answers

Trying to access the Slider component 1 Answer

"using UnityEditor;" throws an error? 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