SC1585 "Member modifier 'protected' must precede the member and type name."

Is there a fix anyone can tell me? I appreciate any working one.

Welcome to the community. :slight_smile:

Are you able to post your code so we can take a look?

It sounds like you’re missing a semi-colon or have something in the wrong order, but we won’t know until we see your code.

the problem came from this specific part of the code.

protected Vector3 InitializePosition()
{
return default(Vector3);
}

protected virtual void ResetControlState()
{
}

protected virtual bool TweakIfNeeded()
{
	return false;
}

protected virtual bool IsTouchCaptured(out Touch capturedTouch)
{
	capturedTouch = default(Touch);
	return false;
}

private bool IsTouchInZone(Vector2 touchPosition)
{
	return false;
}

protected abstract void TweakControl(Vector2 touchPosition);

}

protected Vector3 InitializePosition()
{
return default(Vector3);

this part wasnt in the reply, not sure why.

Can you screenshot the full error message? It will contain a line number in brackets to tell you exactly which line is the problem.

(Edit: Removed initial suggestion, I’m being blind)


ah, well here anyways

Ok, so from that message we can see that the issue is on line 266 – this can be really helpful to narrow down the source of errors! :slight_smile:

Can you screenshot that part of the code? (Not just line 266, but a few lines either side too)

The code you posted above looks fine, so it seems to be something else.

image

the code i posted above had the error, Now i am pretty sure its a problem with Visual Studio. If ti is a Visual Studio problem, I will find a way to fix it. Thank you for your help tho!

Hmm. Is IsTouchCaptured() line 266? I can’t see anything obvious, so it might be a VS problem.

If you want to private message me the whole file I’d be happy to take a look.

Good luck!

thank you! and line 266 is “protected Vector3 InitializePosition()”

Sorry for not getting a better image.

Ah, the problem is probably above that then. :slight_smile: Happy to check if you want to post the lines above.

I see. Thanks for your help anyways!

No problem. My advice would be to check the method above InitializePosition(), this error is normally caused by a semi-colon or missing bracket.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms