• 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 /
This question was closed May 08, 2013 at 09:08 PM by Julien-Lynge for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by SMASapps · May 07, 2013 at 11:40 PM · errorfixedupdatetypeexpected

error CS1031: Type expected fix

//this is my ChangeCameraMoreSimple.cs script // CharacterController.js is another script, I tried adding the script, CharacterController, but got this problem

using UnityEngine; using System.Collections;

 public class ChangeCameraMoreSimple : MonoBehaviour
 public class CharacterController : MonoBehaviour
 
 {
     public GameObject carCamera;
     public GameObject playerCamera;
     public GameObject Car;
     public GameObject Player;
     
     // Use this for initialization
     void Start () {
         
     }
     
     // Update is called once per frame
     void Update () {
         if (Input.GetKey(KeyCode.E))
         {
             carCamera.active = true;
             playerCamera.active = false;
 
             
             Player.active = false;
             Car.active = true;
         }
         if (Input.GetKey(KeyCode.R))
         {
             playerCamera.active = true;
             carCamera.active = false;
             
                Player.active = true;
             Car.active = true;
             GetComponent(CharacterController).enabled = true;
 
         }
     }
 }
Comment
Add comment · Show 5
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 Crazydadz · May 08, 2013 at 12:08 AM 0
Share

Why are you GetComponent().enabled inside itself?

avatar image SMASapps · May 08, 2013 at 12:12 AM 0
Share

what should it be then?

avatar image Crazydadz · May 08, 2013 at 12:20 AM 0
Share

is this your camera script or your charactercontroller script? If you are in your camera script getcomponent is ok

avatar image Crazydadz · May 08, 2013 at 12:22 AM 0
Share

public class ChangeCamera$$anonymous$$oreSimple : $$anonymous$$onoBehaviour public class CharacterController : $$anonymous$$onoBehaviour? You cant do this.

avatar image SMASapps · May 08, 2013 at 08:57 PM 0
Share

how do i add a script to this script, as i have a line which is " GetComponent(CharacterController).enabled = true;" this calls for a "CharacterController" script, wouldn't I need to find the script called "CharacterController"?

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by Julien-Lynge · May 08, 2013 at 09:02 PM

@SMASapps,

Your post (as it appears now) clearly isn't something we can give you one answer for - there are numerous problems with your script, and it's obvious that you're in a bit over your head. It sounds like what you're looking for is Unity training, rather than a specific answer. I would suggest visiting the following training websites to find the one that best helps you move forward. In addition to the sites below, you can always search YouTube, which has a large number of user-created Unity tutorials.

  • 3DBuzz (hover over the Unity dropdown) - http://www.3dbuzz.com/vbforum/sv_home.php

  • Lynda - https://www.lynda.com/

  • BurgZergArcade - http://www.burgzergarcade.com/

  • Unity3DStudent - http://www.unity3dstudent.com/

  • UnityGems - http://unitygems.com/

  • CGCookie - http://cgcookie.com/unity/

Comment
Add comment · Show 9 · 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 SMASapps · May 08, 2013 at 09:04 PM 0
Share

no spam$$anonymous$$g please

avatar image Julien-Lynge · May 08, 2013 at 09:08 PM 0
Share

@S$$anonymous$$ASapps,

This isn't spam, these are a list of resources to help you solve your problem. I am closing your question - Unity Answers does not exist to bugfix your code for you - that is up to you to do if you want to be a game developer. We are happy to help you learn Unity, which is what I'm attempting to do here. Good luck!

avatar image SMASapps · May 09, 2013 at 07:54 PM 0
Share

it is spam as it's something people say to make people thing 'i'm s***'

avatar image Julien-Lynge · May 09, 2013 at 07:57 PM 0
Share

Please don't be disrespectful to people that are trying to help you.

You are not 'entitled' to our time - when we try to help you, we do it for free, out of the goodness of our hearts. If you don't think an answer is helpful, don't disrespect the person giving it. Just tell us that you don't think it's helpful, and explain why.

avatar image SMASapps · May 09, 2013 at 11:22 PM 0
Share

your the disrespectful one. because your saying i'm stupid and then you act the victim

Show more comments

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

13 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

Related Questions

Expression denotes a 'type' 2 Answers

unity script error 1 Answer

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

Problem with var in C# (Vector3, transform and similiar) 1 Answer

The nested type `Find' does not exist in the type `UnityEngine.GameObject' 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