I’m creating a pong game and i’m making script for the paddle to move it and i’m not sure why it’s not working any help would be appreciated
using UnityEngine;
public class PaddleMovement : MonoBehaviour
{
public Rigidbody rb;
public float sidewaysforceright = 500f;
public float sidewayforceleft = 500f;
// Start is called before the first frame update
void Start()
{
}
// we are using Fixed update to
// mess with unity physic’s
// Update is called once per frame
void FixedUpdate()
{
if (Input.GetKey(“w”));
{
rb.AddForce(0, 0, sidewaysforceright * Time.deltaTime);
}
if (Input.GetKey(“s”));
{
rb.AddForce(0, 0, sidewayforceleft * Time.deltaTime);
}
}
}