could some one help me im making a golf game here is my script
var isload = false;
var self;
var bullet : Transform;
self = Quaternion.identity;
function update (){
if (Touch.level_change){
isload = true;
}
if (isload){
Application.LoadLevel(2);
}
}
What’s Touch? There’s a struct Touch in Unity, but it hasn’t any level_change field. If Touch is a script name, you should change it to avoid access problems with the struct Touch.
Anyway, your code could be fixed and improved like this:
var bullet : Transform;
// you can declare the variable and initialize it in the same instruction:
var self = Quaternion.identity;
function Update (){ // update doesn't exist: it's Update!
// apparently, the variable isLoad isn't necessary:
if (Touch.level_change){
Application.LoadLevel(2);
}
}