Ok so basically i am making a 2d game, and im new to unity.
So what i want to do is to make the object move when i press a speicific key.
This is my script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour { }
public Rigidbody rb;
public GameObject Sphere;
// Update is called once per frame
{void FixedUpdate()
{
if (Input.GetKey("d"))
sosis.AddForce(1, 0, 0);
if (Input.GetKey("a"))
sosis.AddForce(-1, 0, 0);
}
}
the problem is at the curly brackets before the word “void” and the last curly brackets. Its says “Type or namespace definition, or end of file expected”
Please help