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
}
Could you expand by explaining what doesn't work? Are you getting errors, or the sounds not playing, or the Target isn't rotating?
Your answer
Follow this Question
Related Questions
All my materials are pink! 1 Answer
OnTriggerEnter not call in 2019 but 5.6version is OK 0 Answers
question about unity version update 0 Answers