As the title said, when i walk into the area, the door won't close. I put it like this:
Code:
void CloseDoorScare(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
}
Please help.
That code doesn't close the door. It only makes it closed as if you didn't hold the handle down. To close it, you will need to make an AddPropImpulse.
i've made the same ;
Code:
void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea", "Callback", true, 1);
}
void CallBack(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("sewer_arched_1", true, true);
//ofc i added some more events to happen ;) this one i used for the door :P
}
now you have to fill your own propeties
this wil suddenly close the door in a blink of an eye
but it won't close it as a effect, just look unatural. If you can't see the door and it close, then you can use it i geuss
if you want to see the door closing like a 'bang' you should use AddPropImpulse, as junkfood said
I use the "AddPropImpulse" script for the door but it won't open, it only looks like someone kicked the door
.