My code is not working. On line 26, my rb.AddRelativeForce(Vector3.up) is not working. I am on lecture 36 of Complete C# Unity Game Developer 3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
ProcessThrust();
ProcessRotation();
}
void ProcessThrust()
{
if(Input.GetKey(KeyCode.Space))
{
rb.AddRelativeForce(Vector3.up);
}
}
void ProcessRotation()
{
if (Input.GetKey(KeyCode.A))
{
Debug.Log("Rotating Left");
}
else if (Input.GetKey(KeyCode.D))
{
Debug.Log("Rotating Right");
}
}
}