- Home /
Question by
ITShrewd · Aug 15, 2013 at 09:49 AM ·
shoottransformdirection
shooting problem
So, I've got this problem on my game: I have a rolling ball, and I want it to fire a balls as a bullets.
GameObject Bullet = (GameObject)Instantiate(bullet,transform.position,transform.rotation);
Bullet.rigidbody.AddForce(rc.transform.TransformDirection(Vector3.forward) * 10);
I want to add force on bullet in the direction of rc object, when I hit play , everything goes right until the vector returned from TransformDirection function contain a negative values(x,z), then the direction of the bullets stuck at last positive values for this vector.
Sorry for bad English.
Comment
Answer by ITShrewd · Aug 15, 2013 at 04:59 PM
I figured it out..... By using Physics.IgnoreCollision function.
Your answer
![](https://koobas.hobune.stream/wayback/20220613112247im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Destroy gameObject on collision/time? 0 Answers
Animation when mouse button is held down? 0 Answers
BCE0005: Unknown identifier: 'DirectionRay'. 1 Answer
Cloud recognition in Vuforia 0 Answers
Shoot 10 bullets at once 1 Answer