hi, i have a aircraft with 8 children rockets(no instantiate),pressing fire1 first rocket is launched, if press again Fire1 second rocket is fired, this for the 8 rockets
can´t resolve the problem any sugestion of how implement this?
I would add a script with a fire function to the rockets and a second script to the aircraft. In this script I would put all the rockets in an array and fire them by increasing a variable:
var rockets : Transform[] = new Transform[8];
var rockIndex : int = 0;
function Update() {
if(Input.GetMouseButtonUp(0)) {
if(rockIndex < rockets.length) {
rockets[rockIndex].SendMessage("Fire");
rockIndex++;
}
}
}