Frictional Games Forum (read-only)

Full Version: Reversing collide callback
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to create an EntityCollideback that triggers when something enters OR leaves a script area. I'm trying to test it by having a light turn on or off depending on whether the object is placed there or not.

AddEntityCollideCallback("EarthRock", "EarthArea", "PlaceEarth", false, 1);

void PlaceEarth(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
FadeLightTo("PointLight_9", 0.0f, 0.7f, 0.0f, 1.0f, -1, 1);
}
else
{
FadeLightTo("PointLight_9", 0.0f, 0.0f, 0.0f, 1.0f, -1, 1);
}
}

For the life of me i can't figure out what's wrong, but the light isn't turning off when I remove the object. I copied the syntax exactly from an area that damaged your sanity if you were standing inside it, which worked perfectly.

Never mind, I naturally solved it myself moments after posting the thread.