I have an array of objects that the play can climb on. What i want to do is make it so on the player Climbing_player = true if variable climbing = true in any of the objects of the array. However i dnt know how to check if a variable is true in each one.
This is the code on the player checking if the varable is true.
var body : Rigidbody2D;
var climb_objects : GameObject[];
var climbing_player : boolean = false;
function Start ()
{
climb_objects = GameObject.FindGameObjectsWithTag("Climb_obj");
}
function Update ()
{
for (var Climbing in climb_objects)
{
if(Climbing)
climbing_player = true;
}
if(climbing)
{
body.gravityScale = 0;
}
}