Hi Connor,
Your screenshot displays a warning not an error, as such this isn’t going to stop your code from executing, however, it may prevent a your code from compiling and as such recent changes may not get included when you run your game.
The specific warning is caused by the special characters used for line endings, if you are using a Mac, for example, but you copy/paste some code into your script which has been provided by someone using Windows, you’ll have different line ending characters.
The easiest way to resolve this is;
- within Visual Studio goto the File / Save As… option
- click on the down arrow next to the Save button
- select Save with Encoding and confirm the prompt
- click on the drop down menu for Line Endings
- select the appropriate option for your operating system
- click Ok to confirm the changes
Regarding your problem, it’s not possible to diagnose from that code example you have provided, which in itself, doesn’t seem to relate to player input.
Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.
You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.
Hope this helps
See also;