(3D) Input.GetAxis("Horizontal"); not being accepted

I’m currently following a tutorial to try and learn unity 3D character movement and the code for the movement isn’t working, returning “unexpected character “””" in the console around my Input.GetAxis(“Horizontal”); and Input.GetAxis(“Vertical”);
Here’s my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
   public CharacterController characterController;
   public float speed = 6;

    // Update is called once per frame
    void Update()
    {
   Move();       
    }

   private void Move()
   {
   float horizontalMove = Input.GetAxis(“Horizontal”);
   float verticalMove = Input.GetAxis(“Vertical”);

   Vector3 move = transform.forward * verticalMove + transform.right * horizontalMove;
   characterController.Move(speed * Time.deltaTime * move);
   }
}

I’ve verified that these are the same names used in my input manager and I’ve been searching for a couple hours and haven’t found a way to fix this, if there’s anything apparently obvious with my code or a way to fix it, I’d appreciate the help.

The quotation marks in your code copy look a little different than normal ones:

"Horizontal"

Something up with your keyboard perhaps? Looks like it’s the ‘modified double apostrophe’ according to character map.

1 Like

This did solve my problem, thank you!
That’s very weird, I’m writing in MacOS’s TextEdit, and it seems to convert surrounding “” into “”.
I was able to disable this under Edit/Substitutions/Smart Quotes disabled.

2 Likes

Uhhgg, :slight_smile: You really should use an actual IDE. It also helps you with syntax highlighting, code suggestions and syntax errors. Visual Studio does also exist for MacOS. It probably has the most features. Though any other kind of IDE would be better than a rtf editor to write letters ^^.

1 Like