Hi, I am using hole colliders. I have attached an image 1 following. I have defined in script
var holeColliders : Transform[ ];
Now, I give a size and assign holeColliders one by one as shown in figure 2 in the following figure.
This is so much time consuming. Is there a way that I will only assign WholeColliderMaster to my script and then I will access all colliders in the WholeColliderMaster. Any suggestions, Waiting for your precious help;
var wholeColliderMaster : Transform;
var holeColliders : Transform[];
@ContextMenu ("Assign Hole Colliders From Master")
function AssignHoleCollidersFromMaster ()
{
var temp = new Array ();
for (var tra : Transform in wholeColliderMaster)
temp.Add (tra);
holeColliders = temp.ToBuiltin (Transform);
}
Assign the master to the wholeColliderMaster variable. Then right-click the script on the GameObject and select “Assign Hole Colliders From Master”.
I have one more porblem. I want to assign in specific order the whole array. So that, WayPointRed0 will assign to Element 0; WayPointRed1 will assign to Element 1; WayPointRed2 will assign to Element 2; and so on but the above code is not doing this…Any suggestions, waiting for your precious help…
I have one more porblem. I want to assign in specific order the whole array. So that, WayPointRed0 will assign to Element 0; WayPointRed1 will assign to Element 1; WayPointRed2 will assign to Element 2; and so on but the above code is not doing this…Any suggestions, waiting for your precious help…