I have this area which when a player looks at it, it forces a door to burst open. Here is the coding I have:
Added in onstart:
SetEntityPlayerLookAtCallback("wind", "windopen", true);
Another function I have set to activate the area:
void OnPickup(string &in asEntity, string &in type)
{
if(type == "OnPickup")
{
SetEntityActive("doorunlock", true);
SetEntityActive("wind", true);
}
}
and last but not least, the actual door function:
void windopen(string &in asEntity, int alState)
{
SetSwingDoorDisableAutoClose("earthquakedoor", true);
SetSwingDoorClosed("earthquakedoor", false, true);
AddPropForce("earthquakedoor", -900, -900, -900, "world");
}
Any help would be much appreciated. ALSO telling me to use the collide callback function will not help as I want it to activate after I look at the area.