Random AA bursts in flight sim
So i want to give the appearance that you are flying through AA fire with random bursts all around you and maybe even one hitting you. My first attempt was to actually have AA guns on the ground actually launching projectiles but unreliable as altitude had to be figured in and the plane is just too fast. So I think just spawning the flak explosions within a random range of the plane is the way to go. Only not sure how. I tried transform.position = Random.insideUnitSphere * range; but that seems to be worlds space rather than in relation to plane. The code below instantiates the flak at a random spot within range ( 5 is range for now), but at world zero. How do I make it so the Random.insideUnitSphere center is based on plane?
if (Input.GetKeyDown(KeyCode.V)){
transform.position = Random.insideUnitSphere * range;
Instantiate (flak , transform.position ,transform.rotation);
}
Your answer

Follow this Question
Related Questions
How to spawn a prefab every 5 second randomly between a set range? 0 Answers
make enemy fire at randomly times? 0 Answers
how to Spawn prefab infront off player and destroy it when hr passed it 0 Answers
Random spawn on screen 1 Answer
How do you spawn a gameobject based on last object in array and limit that within a range? 1 Answer