error CS1061 does not contain Position, says I am missing a directive or assembly reference ?

Hi I am getting an error message trying to make something fly

My error message says
error CS1061: Type “UnityEngine.Transform” does not contain a definition for “Position” and no extension method “position” of type “UnityEngine.Transform” could be found (are you missing a using directive or an assembly reference?)

75007-unity-script.png

2 Answers

2

Hi @djk7

Unity uses the coding convention of camel case for a large portion of it’s API. This means that every variable begins with a lowercase letter and every subsequent word begins with a capital letter.

The only reason I explain this is because you are using a capitalized ‘P’ for position when it should be lowercase.

Simply replace all instances of transform.Position with transform.position

I hope this helps.

thankyou for your help! @Cepheid

I added it and the position numbers seem to go up and down but its not obviously moving, There is a warning in the transform box:
Due to floating-point precision limitations it is recommended to bring the qworld coordinates of the GameObject within a smaller range