# My rockets are going through buildings?

 0 Hi the problem im having is that when my airplane is firing rockets, the rockets cant collide with anything in the world i have created, they just go through the walls. This is the script i have on the rockets. The rockets are rigidbodys. ``````var explode: Transform; function OnCollisionEnter(collision : Collision) { Instantiate(explode,transform.position, transform.rotation); Destroy(gameObject); } `````` more ▼ asked May 30 '10 at 05:52 PM Marcus 41 ● 6 ● 6 ● 11 Cyclops 7.1k ● 33 ● 63 ● 115 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

 0 http://www.youtube.com/watch?v=5pflkVNRvBc&feature=related more ▼ answered May 30 '10 at 07:05 PM jack 1 464 ● 31 ● 40 ● 56 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users
 0 Try setting up some rigid body physics for the building's as well, which would also keep the character from walking through them as well. more ▼ answered May 30 '10 at 06:00 PM jack 1 464 ● 31 ● 40 ● 56 ive done that the plane cant go through the buildings but the rockets can so frustrating. May 30 '10 at 06:32 PM Marcus http://unity3d.com/support/resources/tutorials/fpstutorial Check out the tutorial for starters, and also he brings up a good point. May 30 '10 at 06:56 PM jack 1 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users
 0 If you're firing a rocket, it may be that the rocket is traveling too fast to hit the building. So if it's going at a couple hundred feet per second, the frame where it would collide with the building is not ever actually hitting. If that is the case, try using a Raycast to detect collision. more ▼ answered May 30 '10 at 06:46 PM karl_ 2.4k ● 41 ● 53 ● 69 yeah but should`nt it work when i slow down the speed of the rocket May 30 '10 at 07:07 PM Marcus add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

By Email:

Topics:

x1682
x274
x68

asked: May 30 '10 at 05:52 PM

Seen: 1035 times

Last Updated: May 30 '10 at 05:54 PM