Issue with "Switch" script

Hello,

I’m receiving this issue. Does someone know what’s the problem?

The error in english would be something like: "It requires one reference object for the field, method or propierty non statics “CameraRaycaster.layerHit.get”

you have declared the cameraRaycaster in Start()

so shouldnt it be a lower case c in the switch statement;

void Update() {
 switch (cameraRaycaster.layerHit) // lower case ' c '

as the one with a capital ‘C’ is a type, but lower case ‘c’ is the instance variable.

3 Likes

Oh! Thank you! That was, I was becoming crazy :joy:

1 Like

Privacy & Terms