Issue with player movement script, need help

I’m trying to make a runner game using the runner game template of U2021.3 and I am switching the provided playercontroller script with a fresh one made on my own and switched the default player avatar with a vehicle too. I want to add WSAD movement but its just not moving in in play mode

There are a ton of errors in it. What should I do?

When you have a question about coding it’s best to provide as much information as possible. Following this template significantly increases the chances of receiving an answer that resolves your issue:

  1. Share your entire relevant scripts in a code block rather than a screenshot:

```csharp
// your copy/pasted code here
```
  1. Include any errors or warnings you encountered, along with their exact messages.
  2. Explain what you were trying to achieve.
  3. Describe what actually happened versus what you expected. (Doesn’t work, is not a good description)
  4. List any troubleshooting steps you’ve already attempted.
  5. Provide steps to reproduce the problem, if possible.

This makes your question clearer and shows that you respect others’ time:

  • Using a code block lets people easily copy and test your script instead of retyping it.
  • Sharing the full script allows others to run it on their own machines and provides proper context.
  • Providing the exact error message (if any) helps identify the issue more efficiently.
  • Clearly stating your goal prevents guesswork about what you’re trying to accomplish.
  • Describing what actually happened (rather than just what you expected) helps them reproduce the issue.
  • Sharing what you’ve already tried prevents them from wasting time on the same solutions.
  • Overall, clear and complete information saves everyone from playing “20 questions” just to understand your problem.

In this case fortunately the error is only one and is a well known error that happens when you use the old input system but in the settings the new one is selected. Go to Edit → Project Settings. In the Player tab on the right, look for the option Active Input Handling. If it says Input System Package (New), change it to Input Manager (Old) or Both and click Apply in the pop-up. Save if prompted.

Unity will restart and may display a message like this:

This project is using the new input system package but the native platform backends for the new input system are not enabled in the player settings. This means that no input from native devices will come through.
Do you want to enable the backends? Doing so will RESTART the editor.

Click NO.

Then if there are no other errors and the logic in your script is correct, you will be able to move your character.

It seems like you’re trying to use the old Input System provided by Unity. There’re some tutorials on YouTube showing how the new Input System works and some basics. You can try switching to the old input system but it’s not the best option.

Edit: I was able to fix it, changed the active input handling in project settings to both

Hi thanks for the advice, I’ll follow it next time onwards

Hi. yes I changed the input system to both for now. So far so good, fingers crossed.