Frictional Games Forum (read-only)

Full Version: Colliding an area to set another area active?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, i'm making my custom story and i need to set an area inactive until the player collides with another area. ¿Is that possible?¿How?

Thanks in advance
(07-29-2012, 02:34 AM)ExenderVes Wrote: [ -> ]So, i'm making my custom story and i need to set an area inactive until the player collides with another area. ¿Is that possible?¿How?

Thanks in advance
.
Yea, it's possible!
The area you want inactive should be inactive in the Level Editor. Lets call the active area "Area_1" and the inactive area "Area_2"

Code:
void OnStart()
{
    AddEntityCollideCallback("Player", "Area_1", "SetAreaActiveFunc", true, 1);
}

void SetAreaActiveFunc(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("Area_2", true);
}
It worked!

Thanks ;D