need help please, i have a problem with a game attribute.
being working for 2 hours and can't make it to work. ok so i have
actor1
actor2
actor3.
hero
i need when hero is touching actor1 to change game.attribute "go" to 1(this works fine)
2nd rule is when hero is touching actor1 and actor2 to change "go" to 2.
so i add 2 hero's in the scene, one hero is touching actor1 and the other actor2 but is showing the go attribute=1
actor1
actor2
actor3.
hero
i need when hero is touching actor1 to change game.attribute "go" to 1(this works fine)
2nd rule is when hero is touching actor1 and actor2 to change "go" to 2.
so i add 2 hero's in the scene, one hero is touching actor1 and the other actor2 but is showing the go attribute=1
Comments
Here is what you should have:
//These are game variables
integer go;
boolean heroTouching1;
boolean heroTouching2;
//So if the hero is touching actor1 then set go to 1 and heroTouching1 to true
if (hero "overlaps or collides" "with actor fo type" actor1)
{
heroTouching1 = true;
go = 1;
}
//and this is for when the hero is touching actor 2 set heroTouching2 to true
if (hero "overlaps or collides" "with actor fo type" actor2)
{
heroTouching2 = true;
}
//then if both actor1 & actor2 are touching a hero then it changes go to 2
if (heroTouching1 == true && heroTouching2 == true)
{
go = 2;
}
Hope I helped!
-Josh