e.g how to fix unity error saying expecxted }
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class playerspaceship : MonoBehaviour { public float ThrustForce = 1000f; public float TurnTorque = 1000f; private Rigidbody rigidbody;
private void Start() { _rigidbody = GetComponent<Rigidbody>();
}
private void FixedUpdate() {
if (Input.GetKey(KeyCode.W)) { _rigidbody.AddForce(transform.forward * ThrustForce * Time.FixedDeltaTime);
}
if (Input.GetKey.A) { _rigidbody.AddTorque(-transform.up * TurnTorque * Time.FixedDeltaTime); } else if (Input.GetKey(KeyCode.D)) { _rigidbody.AddTorque (transform.up * TurnTorque * Time.FixedDeltaTime); { // Start is called before the first frame update void Start() {
}
// Update is called once per frame
void Update()
``` {
}
} {{{