Ok, so after the last time I posted this thanks to a few kind people, I saw that I had glazed over some just stupid things that I didn’t think about when originally writing my scripts. Now I have removed those aspect and added a few log entry calls so whenever an action is performed it’s logged.
Anyways to the point my scripts are still not interacting the way I wan’t them to or not at all.
The script I have checking the number correct doesn’t seem to work if I assign the adding of numbers to any function other than Update and if I set it in update it simply adds 1 to the number every frame the second the game is started.
The script in question:
#pragma strict
var correct : int = 0;
var callTrue : boolean;
function Start() {
correct = 0;
callTrue = false;
}
function Update(){
if(correct == 25){
Debug.Log("Win");
}
}
function Go(){
correct = correct + 1;
Update();
}
And just in case you wan’t the script making the calls to this one.
#pragma strict
var checkTrue = boolean;
var correctCor : Vector3;
var card : GameObject;
function Update () {
var ArrayScript : ArrayCorrect = GetComponent(ArrayCorrect);
if(card.transform.position == correctCor){
Debug.Log("I'm at the spot D:");
ArrayScript.Go();
Debug.Log("Adding one to ArrayCorrect.js");
}
}
I’m sure I’m just glazing over something but sometimes I genuinely need other people to just point things out for me that I would otherwise catch.
Thanks in advanced.