this.transform and other code which starts with this. has the error No Definition. Need help.

Here is a piece of the script but the error is appearing everywhere, even in scripts that used to work.

this.transform.position = new Vector3(this.transform.position.x, -2.67f, mid.z);

“this.transform” has the error message(and also happens with this.gameObject) which reads:

Assets/Scripts/[SCRIPTNAME].cs(41,56): error CS1061: ‘[SCRIPTNAME]’ does not contain a definition for ‘transform’ and no accessible extension method ‘transform’ accepting a first argument of type ‘[SCRIPTNAME]’ could be found (are you missing a using directive or an assembly reference?)

Please help.

There is no way of knowing exactly what the problem is without the whole script

is your class [scriptname] deriving from Mono behavior?
like that?

public class [scriptname] : monobehavior
{
 //all your methods
}

or is it missing monobehavior?
if it is you should add it where your class name is defined like in the above code snippet