Hi , I’m working on kind of shooting mechanics and I stuck on that point. I want to set my bullet rotation exactly same with ray line. I created bullets with this code :
Rigidbody clone; Ray vRay = myCam.ScreenPointToRay(Input.mousePosition); clone = Instantiate(bullet,transform.position, NEEDSOMETHINGHERE) as Rigidbody; clone.rigidbody.AddForce(vRay.direction * shootForce); Destroy(clone.gameObject, 1);
this code create a clone of my bullet and throw it to somewhere that i click but rotation is not true.
Here is an visualization of what i want: