- Home /
Can't add script behaviour Joystick.js. The scripts file name does not match the name of the class defined in the script!
I'm getting this error..
Can't add script behaviour Joystick.js. The scripts file name does not match the name of the class defined in the script!
i don't understand why i'm getting this error. this is my first day on unity. i come from java, writing android apps. why does this error happen when this is the only joystick,js file in my application i'm making?
how do i fix it.
@script RequireComponent (GUITexture)
private var gui2 : GUITexture;
function Start () {
gui2 = GetComponent (GUITexture);
defaultRect = gui2.pixelInset;
}
function Update () {
var count = Input.touchCount;
for (var i: int = 0; i < count; i++)
{
var touch : Touch = Input.GetTouch(i);
if (gui2.HitTest ( touch.position))
gui2.pixelInset.x = touch.position.x;
gui2.pixelInset.y = touch.position.y;
}
}
Comment
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Crash on Mac, when switching application 1 Answer
Realtime shadow not working on Mac with Radeon HD 0 Answers