Reversing collide callback
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.
(This post was last modified: 03-29-2012, 08:32 PM by Damascus.)
|