- Home /
The question is answered, right answer was accepted
Help with error: Expression denotes a `type', where a `variable', `value' or `method group' was expected
I'm following the tutorial to try and get a GUI up an running, but it just gives errors:
Assets/GolfWarsAssets/Objects/Game/GameController.cs(110,18): error CS0119: Expression denotes a type', where a
variable', value' or
method group' was expected
I am using c# - perhaps I am missing a reference? Any clues?
Answer by runevision · Dec 15, 2009 at 08:14 AM
When using C# you need to use the new keyword in front of all constructors. Constructors are like functions that are used to create new objects (or scructs). They always have the same name as the type of object you are creating.
So if you are creating a new Rect using the constructor Rect()
then you need to write new Rect()
if you are using C#.
Answer by Mark Davies · Nov 30, 2009 at 11:02 PM
Doh! figured it out. When using C#, you need to add new in front of Rect for the examples given in javascript if anyone else is having the same trouble!