Search Unity

Syntax error, ',' expected

Discussion in 'Scripting' started by Jaklarkob, Feb 11, 2021.

  1. Jaklarkob

    Jaklarkob

    Joined:
    Feb 11, 2021
    Posts:
    1
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Movement : MonoBehaviour
    6. {
    7.  
    8.     private bool walk = true;
    9.     public int Speed;
    10.  
    11.     // Start is called before the first frame update
    12.    
    13.     void Start()
    14.     {
    15.         walk = true;
    16.  
    17.         if (walk == true)
    18.         {
    19.             transform.position = transform.position + new Vector3(1 * Speed * Time.deltaTime, 0, 0);
    20.         }
    21.     }
    22. }
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Joe-Censored and Schneider21 like this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The error includes both the script name and the line number.