Search Unity

Question Empty character literal Issue

Discussion in 'Editor & General Support' started by MrJackalope, Jan 22, 2022.

  1. MrJackalope

    MrJackalope

    Joined:
    Jan 21, 2022
    Posts:
    2
    Hey there!

    Its actually my first day on unity and I was about to make the script for "Movement" for my game from a YouTube tutorial however once it was done I've recieved an error. I've re-watched the video multiple times and I made sure 100% I coppied everything correctly

    The error is :
    Assets\Scripts\PlayControl.cs(29,12): error CS1011: Empty character literal

    I typed the " but I think it's missing something inside. Could anyone please help I know I should be looking at tutorials first but I will after :)

    Thanks in advance! Here's the code btw


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayControl : MonoBehaviour
    6. {
    7.     public Rigidbody rb;
    8.     public float moveSpeed = 10f;
    9.  
    10.     private float xInput;
    11.     private float yInput;
    12.  
    13.     // Start is called before the first frame update
    14.     void Awake()
    15.     {
    16.         rb = GetComponent<Rigidbody>();
    17.     }
    18.  
    19.     // Update is called once per frame
    20.     void Update()
    21.     {
    22.     // Good for handling inputs and animations
    23.     ProcessInputs();
    24.     }
    25.  
    26.     private void FixedUpdate()
    27.     {
    28.     // Movement
    29.     Move();''
    30.     }
    31.    
    32.     private void ProcessInputs()
    33.     {
    34.         xInput = Input.GetAxis("Horizontal");
    35.         yInput = Input.GetAxis("Vertical");
    36.     }
    37.  
    38.     private void Move()
    39.     {
    40.         rb.AddForce(new Vector3(xInput, 0f, yInput) * moveSpeed)
    41.     }
    42. }
    43.    
    44.  
    45.  
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    You have a stray pair of quotes at the end of line 29 for some reason. Delete them, that's what the error is about. There's no reason you would need a pair of empty quote marks there.
     
  3. MrJackalope

    MrJackalope

    Joined:
    Jan 21, 2022
    Posts:
    2

    Thanks so much it worked.