You’re not using the output variable “horizontal”. Perhaps you meant this;
position.x = position.x + 0.1f * horizontal;
Also, please use code-tags: