![]() |
Turning light on and off in trigger area? - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Turning light on and off in trigger area? (/thread-21437.html) |
Turning light on and off in trigger area? - Dominic0904 - 05-08-2013 Hey everyone, Basically what I wanted to do is have a light turn on when I walk into a trigger area, then turns off again when the player walks out of that trigger area. Then turns on when they walk back into it and so on and so forth. Here's my script so far; PHP Code: void OnStart() So the Spot Light is disabled as soon as the level loads and it turns on fine when the player walks into the trigger area, but it stays on when the player walks out. How can I script it so the player can walk in and out of the trigger area to make the light go off and on? Thanks. RE: Turning light on and off in trigger area? - ClayPigeon - 05-08-2013 Code: AddEntityCollideCallback("Player", "wrong_door_area", "WrongDoor", false, 1); RE: Turning light on and off in trigger area? - Dominic0904 - 05-08-2013 (05-08-2013, 08:17 PM)ClayPigeon Wrote: That didn't work sadly, the light still turns on, but stays on when I walk around away from that area ![]() RE: Turning light on and off in trigger area? - ClayPigeon - 05-08-2013 Code: AddEntityCollideCallback("Player", "wrong_door_area", "WrongDoor", false, 0); RE: Turning light on and off in trigger area? - Dominic0904 - 05-08-2013 (05-08-2013, 08:53 PM)ClayPigeon Wrote: Perfect! Thank you very much! Now I'm just going to add sound to it as well! |