hey, I need some help. I have a firing range for my fps and i need to know how to get the targets to blow up when you shoot them. it would also help if they can move too. Thanks
asked May 25 '11 at 01:46 AM
No one is going to give you an entire script just for you. Try to do as much of it as you can yourself, and if you run into specific problems we will be more than happy to help. :)
Blowing stuff up requires a few steps:
The first thing you need to do is add a box or mesh collider to your targets. Then you need to make the collider a trigger. There is a check box for each collider to change it into a trigger.
Then you have to write a script that will check for the bullets to collide/intersect the collider.
It will be something like this:
For the target itself, you will have to write a funtion that checks if gotHit is true.
It will look something like this:
I hope this helps! You can add onto, or rewrite this code. I was just giving examples on how to pull it off.
Have a grate time with Unity3d!
answered May 25 '11 at 02:10 AM