Raycast layer problem

so in the following code my raycast will not hit anything…however if I remove that '8’which is the layer number it will work perfectly…only it will collide with every object on screen:`

if(Physics2D.Raycast(touchpos,Vector3.forward,10000,8))
character.transform.Translate(Vector2.rightspeedTime.deltaTime);`

so if someone could tell me whats wrong with my layers, or maybe my code thx in advance

Layer masks are not quite so simple as putting in the layer number. I would suggest using the LayerMask class and adjusting via the inspector.