- Home /
shoot bullet at any direction(random)
hey guys , i have a fruit right ! , when this fruit entres this trigger , i want this fruit to go straight at any direction(any random direction) with a bullet speed , like a bullet, and get destroyed after half a second, so that's it , help please , thanks.
function OnTriggerEnter(other: Collider) {
if (other.CompareTag("Spin")){
Destroy(gameObject, 0.5);
}
}
with questions like that you might not always get good answers, try asking one question that you have trouble with. What is it that you don't understand? the random part? the movement and speed? the wait for half a second? People normally won't just code it all for you, plus it won't help you at all.
@thaiscorpion thanks for the reply man , well okay i didn't understand the random part and the movement and speed !
Your answer
Follow this Question
Related Questions
Destroy Bullet on Random Collision 0 Answers
Destroy bullet on random collision 2 Answers
Cant Destroy specific object 2 Answers
Enemy health and bullet problem 2 Answers
How do I break apart an object? 2 Answers