- Home /
Question by
NYP · Mar 07, 2014 at 11:15 PM ·
javascriptcustom class
Errors when trying to construct custom class in UnityScript
I am getting the following error when i try and construct an instance of a custom class:
I am new to Unity so any help would be greatly appreciated. Thanks
screen shot 2014-03-07 at 22.53.19.png
(57.2 kB)
Comment
Answer by robertbu · Mar 07, 2014 at 11:19 PM
The issue is that you did not declare a type for 'pinkDie' so the compiler defaults to Object. On the first line, change to:
var pinkDie : DieToken;
Note for future posts, we prefer you paste the text of your script into the question, select the text and use the 101/010 button to format the text. Text answers gives us line numbers and the option to check scripts out in the compiler if we cannot spot the problem visually.
Your answer
Follow this Question
Related Questions
How to add class to a static Generic List 1 Answer
Cable-building simulations. 0 Answers
Overload Operator in UnityScript? 0 Answers