Zulbaric

I have made a game with 2 classes one for the game, and one for the sky box. For the skybox to function properly the class SkyBox needs to get some information from the Gam1 class. When i made a reference on the skybox class to the game1 class it said "Error 1 'Game1.modelRotation' is inaccessible due to its protection level"

case 0: //back

f = Vector3.Dot(Game1.modelRotation,new Vector3(0,0,1));

break;

I think the solution may be to make an instance of game1 somehow but being a

C# noob i am unsure on how to fix this. If anyones got any ideas that would be great



Re: XNA Game Studio Express Protection level to high

andyfraser

Hi,

Ensure your property modelRotation is marked as public.

Andy





Re: XNA Game Studio Express Protection level to high

Zulbaric

can you make a vector public if so how :@



Re: XNA Game Studio Express Protection level to high

Stephen Styrchak - MSFT

You need to add a modifier to the member declarations. Here is an example that should help:

GraphicsDeviceManager graphics; // the default is private
private ContentManager content; // you can also explicitly make it private
internal Vector3 modelRotation; // internal means accessible within this assembly
public Vector3 otherThing; // public means accessible from anywhere

--Stephen