unexpected convert float to int error

i’m trying to increment the x coordinate of a vector2 by a certain amount (defined in the inspector), but it says that it cannot implicitly convert from type float to int. i don’t understand why i’m getting this problem because the value i’m incrementing it by is a float. the code i’m using to increment it is below.

 position.y += spacing;

this is the code i’m using to define the variables

 public float spacing;
 public Vector2 position;

please help, i have no idea what’s going wrong.

Greetings, what you have here should work as far as data types. My only suggestion at the moment is to be careful of using “keywords” as variable names. It can cause some weird things happen. So position might be better as targetPosition or something. If it’s not that, then something else is going on in the code. Hope this helps.