x


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?

more ▼

asked Nov 30, 2009 at 10:49 PM

Mark Davies gravatar image

Mark Davies
83 4 4 10

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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#.

more ▼

answered Dec 15, 2009 at 08:14 AM

runevision gravatar image

runevision ♦♦
9.1k 53 77 134

(comments are locked)
10|3000 characters needed characters left

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!

more ▼

answered Nov 30, 2009 at 11:02 PM

Mark Davies gravatar image

Mark Davies
83 4 4 10

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x8827
x3460
x22

asked: Nov 30, 2009 at 10:49 PM

Seen: 28941 times

Last Updated: Dec 15, 2009 at 08:05 AM