I am enrolling unity 2d c# course and i need help

hey, I am enrolling the unity 2d c# class and i have got an error: Assets\Driver.cs(9,28): error CS1002: ; expected
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Driver : MonoBehaviour
{
float steerSpeed = 0.1f

float moveSpeed = 0.01f

void Start()
{
    
}

void Update()
{
    transform.Rotate(0, 0, steerSpeed);
    transform.Translate(0, moveSpeed, 0);
}

}

You just need to close out your variable declaration by adding a semi-colon to the end:

float moveSpeed = 0.01f;

Hi C0bra3055,

Welcome to our community! :slight_smile:

CyberCheese is right. Each statement needs to be closed with a semicolon, not just the line with moveSpeed but also the line with steerSpeed. Remember you can also look at the lecture code changes via the link in the Resources of each lecture.


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms