.this and .gameObject are not working in my script.
Do you have an instance of the gameObject declared as a variable? Need more information, the ‘this’ keyword inside of Unity refers to the object that you’re scripting in, which would directly correlate to the script itself, not the gameObject.
If you have no variable declared and are trying to access it directly, there is no reason why you should be using the ‘.’ in front of the ‘gameObject’, it should just be gameObject.
if you are inside a monobehaviour, this.gameObject should work
I changed to this.gameObject.transform.position and it worked,thanks guys.