There is a
closing } missing in this function:
void Update()
{
float horizontalSpeed = 0;
#if UNITY_STANDALONE || UNITY_WEBPLAYER
horizontalSpeed = Input.GetAxis("Horizontal") *
dodgeSpeed;
if (Input.GetMouseButton(0))
{
horizontalSpeed = CalculateMovement(Input.mousePosition);
}
#elif UNITY_IOS || UNITY_ANDROID
if(horizMovement == MobileHorizMovement.Accelerometer)
{
horizontalSpeed = Input.acceleration.x * dodgeSpeed;
}
if (Input.touchCount > 0)
{
Touch touch = Input.touches[0];
if(horizMovement == MobileHorizMovement.ScreenTouch)
{
horizontalSpeed = CalculateMovement(touch.position);
}
#endif
rb.AddForce(horizontalSpeed, 0, rollSpeed);
}
Advice: Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spotting structures mistakes.
Indentation style - Wikipedia[
^]
Professional programmer's editors have this feature and others ones such as parenthesis matching and syntax highlighting.
Notepad++ Home[
^]
ultraedit[
^]