- Home /
Question by
Cam.Lyall96 · Jul 06, 2016 at 07:27 PM ·
unity 5objectaddforce
AddForce to Object not working [Unity 5]
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<Rigidbody>().AddForce(transform.forward * 300);
}
Comment
Your answer
Follow this Question
Related Questions
How to move object base on where it is facing? 0 Answers
My sphere is not moving in the unity? 1 Answer
Pooling GameObjects with TextMesh ? 0 Answers
How to setActive an Object form another scene? Help please. 2 Answers
How add and mark next object? 0 Answers