Aiming in a 2D sidescroller problem - arrow does not follow the cursor

Thank you very much ! I tried using your example script, and the arrow does indeed follow the cursor.

There is still a little problem. The arrow is not pointing just in XZ plane, it is pointing a bit outwards, in the Y axis. This could cause problems at a later stage, when shooting is implemented. I also tried to attach a gun mesh to the arrow, and it seems that the gun has another kind of rotation, in order to point outwards. I wonder how could I constrain the movement of the weapon/arrow in a single plane, like in 2D games.