Function limitBreak()

I’m following this tutorial.
But i’m stuck here…

function limitBreak(){

Debug.log('limit Break');

}

it says method not found, im new to Javascript or Unityscript.

Here is the whole code.

class CharacterAttributes{

var name : String;
var level : int;
var hp : Stat;
var mp : Stat;

var strength : int;
var dexterity : int;
var vitality : int;
var magic :int;
var spirit : int;a
var luck : int;

var attack : int;
var attackPercent : int;
var defence : int;
var defencePercent : int;
var magicAtk : int;
var magicDef : int;
var magicDefPercent : int;

var exp : int;

function limitBreak(){

Debug.log('limit Break');

}
}

class Stat{
var Current : int;
var Max : int;
}

var cidAttributes : CharacterAttributes = new CharacterAttributes();
var cloudAttributes : CharacterAttributes = new CharacterAttributes();

function Start(){
cidAttributes.level = 99;
cidAttributes.name = "Cid";
cidAttributes.hp.Current = 9999;
cidAttributes.mp.Current = 999;

cidAttributes.hp.Max = 9999;
cidAttributes.mp.Max = 999;

cidAttributes.strength = 255;
cidAttributes.dexterity = 255;
cidAttributes.vitality = 255;
cidAttributes.magic = 255;
cidAttributes.spirit = 255;
cidAttributes.luck = 255;

cidAttributes.attack = 255;
cidAttributes.attackPercent = 255;
cidAttributes.defence = 255;
cidAttributes.defencePercent = 255;
cidAttributes.magicAtk = 255;
cidAttributes.magicDef = 255;
cidAttributes.magicDefPercent = 255;

cidAttributes.exp = 5127637;

cloudAttributes.level = 70;

print(cidAttributes.attack);
print(cloudAttributes.level);
cidAttributes.limitBreak();
}

I have one question thought, is javascript Unityscript or pure Java language ?
Thanks for the time!
~Wentzel

Javascript is UnityScript. people call it Javascript because it’s similar in syntax to Javascript.

also, Javascript isn’t related to the programming language Java either.

as for your problem, I’m not too knowledgeable with UnityScript (I code in C#), but maybe your problem is at the near bottom line where it says.

cidAttributes.limitBreak();

that is requesting that limitBreak() give a return type, whereas you have non just a debug statement. try removing that line and just calling limitBreak(); in the update or something and see if it works.

Huh? No it doesn’t.

You’ve got your Start() method that isn’t in a class. Unless you’re just not showing the entire code base.

The only error I got when I tested exactly what you have is this:

MissingMethodException: Method not found: ‘UnityEngine.Debug.log’.

This is because it is Debug.Log… with a capitol L

once corrected, it worked fine.

Thanks @BigMisterB.

Oh one more question, Where can i mark the threads as solved ?

Thanks
~Wentzel.