Ok so to start off I'm not sure if I'm in the right forum or not but here is my question. I am following this tutorial on making pong in 6 minuets and I'm stuck on a few things. First when I tried to make player 2 work, player 2 would not move so I moved on to the next part thinking I could just make it one player. So then I moved on to making the ball move. I copied all the code he wrote went over it several times and kept getting this error message.( [21:01:26] Assets\ball.cs(26,56): error CS1002: ; expected ). I do not know what it means and I can not find where the error is located at. I would like to know how to understand the message and figure out how to fix it and below is my code.
____________________________________________________________________________________________________________________________
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ball : MonoBehaviour
{
public float speed;
public Rigidbody2D rb;
// Start is called before the first frame update
void Start()
{
Launch();
}
// Update is called once per frame
void Update()
{
}
private void Launch()
{
float x = Random.Range(0, 2) == 0 ? -1 : 1;
float y = Random.Range(0, 2) == 0 ? -1 : 1;
rb.velocity = new Vector2(speed * x, speed * y)
}
}
____________________________________________________________________________________________________________________________