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 Richardfalcos · Apr 28, 2016 at 12:56 PM · versionnew-feature

my script worked and earlier, now does not work Version 5:34

Hi, I am unsure what to do, because my script worked perfectly earlier, Now to my surprise does not work in new versions: The following script was the following: When the player entered the trigger was asked to put a code and door opened, but in the new version 5.3.4 does not work anymore, I spent a great time to get to this point, I decided to switch to the new version and now I am not able to solve it. here is the script if anyone can help me I will be very grateful. Thank you.

 var close = false;
 var CodigoBau : String = "";
 var stringToEdit : String;
 //var estiloAviso = GUIStyle;  
 
 var AngleX : float = 0.0;
 var AngleY : float = 0.0;
 var AngleZ : float = 0.0;
 
 private var targetValue : float = 0.0;
 private var valorAtual : float = 0.0;
 private var easing : float = 0.002;
 
 var Sound:AudioClip;
 
 var Target : GameObject;
 
 function OnTriggerEnter (other : Collider) {
     targetValue = AngleX;
     currentValue = 0.0;
     GetComponent.<AudioSource>().PlayOneShot(Sound);
 }
 
 function OnTriggerExit (other : Collider) {
     currentValue = AngleX;
     targetValue = 0.0;
     GetComponent.<AudioSource>().PlayOneShot(Sound);
 
 }
 
 
 function SetTheGUI () {
     close = true;
     targetValue = AngleX;
     //valorAtual = 0.0;
 }
 
 function UnSetGUI () {
     close = false;
 
 }
 
 function OnGUI(){
 if (close){
     GUI.Box (Rect(Screen.width/2-60, Screen.height/2-80, 150, 35),"DIGITE O CÓDIGO");
     
     stringToEdit = GUI.TextField (Rect(Screen.width/2-60, Screen.height/2-40, 150, 25),stringToEdit, 11);
 
     
    if(stringToEdit == CodigoBau){
    
     GetComponent.<AudioSource>().PlayOneShot(Sound);
     valorAtual = valorAtual + (targetValue - valorAtual) * easing;
     //GameObject.particleEmitter.emit = true;
      
     Target.transform.rotation = Quaternion.identity;
     Target.transform.Rotate (0 , 0, valorAtual);// este funciona
     //Target.transform.Rotate (0 , valorAtual, 0);//gira no eixo y
     //Target.transform.Rotate (valorAtual, 0 , 0);//gira no eixo z
     
     
 } 
       
 
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 Scribe · Apr 28, 2016 at 01:48 PM 0
Share

Could you expand by explaining what doesn't work? Are you getting errors, or the sounds not playing, or the Target isn't rotating?

0 Replies

· Add your reply
  • Sort: 

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

57 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

Related Questions

All my materials are pink! 1 Answer

What version of Unity is compatible with SDK version 6 to set the Target API level 26 for Google Play? 0 Answers

OnTriggerEnter not call in 2019 but 5.6version is OK 0 Answers

question about unity version update 0 Answers

can you make changes to your project after you export it?,can you export your game and make changes after that? 2 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