In a Custom Story I am making, I have an event that is supposed to happen once when the player leaves a set area. The area is a script area, called "SpawnEntranceArea", and the code looks like this:
void EnterSpawnEntranceArea(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("PlayerSpawnDoor",false,false);
AddPropImpulse("PlayerSpawnDoor", 0.0f, -5.0f, 0.0f, "World");
}
...
void OnStart()
{
//Other Startup functions
AddEntityCollideCallback("Player", "SpawnEntranceArea", "EnterSpawnEntranceArea", true, -1);
}
But when I try testing it, nothing happens. I have tried various changes, such as making the event repeatable, allowing it to happen on entering and exiting the area, and setting the result of the function to something basic/mundane (Like giving the player a Tinderbox), but nothing still happens. I've checked this against code in the official maps, and see no noticeable difference. Help anyone?