Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by thenachotech1113 · Jul 21, 2012 at 05:54 PM · camerafpspause

disabling camera script

I am trying to do a pause button on my game, and i want the camera to stop moving, i tied to disable the component but it says enabled its not a part of UnityEngine.GetComponent. so here is the pause script(its attached to the camera as well as the Mouse Look):

 #pragma strict
 
 var isPaused : boolean = false;
 var PauseGUI : GUI;
 PauseGUI.enabled = false;
 
 function Update (){
  if (Input.GetKeyUp(KeyCode.P)){
  if (isPaused){
  isPaused = false;
  }
  else{
  isPaused = true; 
  }
  }
 
  if (isPaused){
  Time.timeScale = 0.000001;
  PauseGUI.enabled = false;
  GetComponent("Mouse Look").enabled = false;
  }
  else{
  Time.timeScale = 1;
  PauseGUI.enabled = false;
  }
  
  
 
 }

thank you all, and if you need more information plz tell me.

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
1
Best Answer

Answer by ScroodgeM · Jul 21, 2012 at 07:09 PM

 GetComponent("Mouse Look").enabled = false;

replace with

 MouseLook ml = GetComponent("MouseLook");
 ml.enabled = false;

AFAIK in JS this will look like

 var ml : MouseLook = GetComponent(MouseLook);
 ml.enabled = false;
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 thenachotech1113 · Jul 25, 2012 at 01:14 AM 0
Share

whell the error went away, still it says to insert a semicolon between GetComponent so anny idea of what could be wrong? btw its in java script so ID$$anonymous$$ what could have gone wrong

avatar image ScroodgeM · Jul 25, 2012 at 05:05 AM 0
Share

i added version for JS. don't like it 8)

avatar image
-1

Answer by neduser · Aug 29, 2012 at 11:41 PM

Thanks :-( but help very need. Project which created in historical faculty not normally work without script (as pause and so on). Studing C+ and Java is very difficult for some humanities. But 3d engine is very popular and needed tools in digital archaeology and historical research. Who any help?

For project - Virtual Reconstruction of Moscow Monastery «All Sorrow Joy» 1909 year http://hist.msu.ru/3D/Joy_of_all_sorrow.htm

Ph.D. Student Denis Zherebyatiev Lomonosov State University Historical faculty Historical Informational Science

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 neduser · Aug 29, 2012 at 12:38 AM

Pleese give normally work script!!!

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 ScroodgeM · Aug 29, 2012 at 09:53 PM 0
Share

this is not a place to get free code, this is place to get answers to questions you have.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

One animation for two objects 0 Answers

raycast spawn problem 0 Answers

How to make camera stop moving in pause menu? 1 Answer

How many cameras can i have? 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