- Home /
using functions as classes
I've already read this article. http://answers.unity3d.com/questions/53364/how-i-can-create-a-javascript-object-in-a-unity-sc.html All over this program, the declarations of this class are saying Cannot convert 'void' to 'Object'.
var temp = new Card("Ace", "Spades");
The class is declared as such:
static var title;
static var suit;
static function Card(title, suit)
{
this.title = title;
this.suit = suit;
if(title == "ace")
this.valu = 1;
else if(title == "jack" || title == "queen" || title == "king")
this.valu = 10;
else
this.valu = title;
}
Comment
Best Answer
Answer by whydoidoit · Jul 02, 2012 at 07:35 AM
You need to remove the word static from in front of your function Card
Your answer
![](https://koobas.hobune.stream/wayback/20220613073554im_/https://answers.unity.com/themes/thub/images/avi.jpg)