0 votes
by (8.2k points)

Hello!
I'm very new to Unity and scripting and recently I got this error when I tried to make some simple movements for my character. I watched a tutorial on YouTube and on the first scripting part I got this error:
Assets\Scripts\BallMovement.cs(8/19): error CSI 002: ; expected

1 Answer

0 votes
by (8.2k points)
  • C# is case-sensitive because it takes after the C-style languages which are all case-sensitive. This is from memory here's an MSDN link which is not working for me right now I can't verify.
  • C# is case sensitive because it takes after the C style languages" language inheritance.
  • In Code int speed = 5 ; 
    You missed ;

using System. Collections;

using System. Collections.Generic;

using UnityEngine;

using UnityEngine.SceneManagement; public class Ballmovement : Monobehaviour

public bool , isMovingFwd, isMovingBwd, isMovingLeft, isMovingRight,

int speed = 5

// Start is called before the first frame update

void Start()

{

}

void Update()

if (isMovingFwd)

{

  MoveForward ( ) ;

}

if (isMovingBwd)

{

  MoveBackward();

}

if (isMovingLeft)

{

  MoveLeft ( ) ;

}

if (isMovingRight)

{

  isMovingRight();

}

TechXR runs courses in AR / VR / Metaverse / Game Development. Some of the popular Q&A in our courses are available here for easy discovery.

113 questions

117 answers

54 comments

105k users

...