Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Help Wanted 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:
    6,804
    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.
     
unityunity