I have search everywhere for a solution to this problem and so far nothing has worked.
My current code is as follows:
if (Input.GetMouseButtonDown(0)) {
Vector3 correctRotation = GameObject.Find("OVRCameraRig").transform.rotation.eulerAngles;
correctRotation.x += 90;
Object bullet = Instantiate(projectile,
GameObject.Find("BaseProjectileSpawn").transform.position,
Quaternion.Euler(correctRotation));
GetComponent().AddForce(transform.forward * 300);
}
↧