- Home /
Answer by Seth-McCumber · Oct 04, 2013 at 06:28 PM
You Could Say When The Bullet Hits The Rock, It Applys A Rigid Body To The Rock. Would Give More Detail, But Your Question Is Unclear.
$$anonymous$$y gun has a bullet then if i shoot that rock, the rock should fall into the water.. i dont know how to do it. :(
Answer by YoungDeveloper · Oct 04, 2013 at 06:21 PM
You could animate the rock, simple drop animation, or if that area is hilly you could just activate its physics and it would roll down OR you could add force till it drops down. If you are using raycast, get the hit object and getcomponent of the script where is the function, which launches the animation. If you are using rigidbody colliders, just get the collider hit, and next is the same process as with raycast.
To get script and call some function on the run, see this example i gave answer for: http://answers.unity3d.com/questions/547347/send-message-on-trigger-enter.html
how can i do the "activate its physics and it would roll down OR you could add force till it drops down."??? please help me :( thanks
Please stop the triple question mark, and "PLEASE HELP", it's annoying. And Sentence starts with a capital letter, not even talking about commas.
Actually i gave you enought information to figure out how it must be done, and what you should search for. But as i see it, your not even trying to understand, just "show me how its done", and by show me, i mean "do the work for me". Program$$anonymous$$g is not typing letters and numbers, it's about training your brain as a muscle for logical thinking and solving problems.
To achieve what you want, you have think about these things:
What will be your bullet, raycast or physical rigidbody
When you will figure out which one will you will choose, make it so you could shoot the bullet on button press.
Next step, when you have your bullet ready, make it when the bullet hits something with a tag "rock" Debug a message in the console.
When you will create all my mentioned steps, come back and i will gladly tell you what to do next. Or when you will encounter problems with program$$anonymous$$g, which most likely happen, poat a new quesrion about your specific problem or here.
$$anonymous$$y bullet is a prefab, i already did the shooting part, i can shoot with my gun. I also did the code wherein my bullet hits a tag "rock" but then the problem the rock is not falling or rolling over.
I added a force to the rock but it still doesnt drop down or rolls to the river.
Your answer
![](https://koobas.hobune.stream/wayback/20220613115319im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Destroy Projectile on collision 3 Answers
Collision with terrain 0 Answers
Bullet and Enemy can't collide and execute functions 1 Answer
How to destroy bullet on collision! 2 Answers
when the bullet hits the bot it still makes the bullet hole 1 Answer