Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

AddForce to Object not working [Unity 5]

$
0
0
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); }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>