Development Unity

Unity C# Error : this.transform No Definition [closed]

Here is a section of my code, but the error is basically happening everywhere(In every script). If you want the full piece of code, tell me but here is a section:

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

The transform word is underlined red stating that it does not contain a definition and no accessible extension. I have no clue how to fix this error. And this error also happened on finished scripts in the past which worked for like a week.


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

I don’t want to show the script name or anything like that but I know the name is not the problem as the script used to work.

Leave a Reply

Your email address will not be published. Required fields are marked *