Honours Project Development: Door System
Updated Doors Opening/Closing system – because new player respawn system it has to close doors automatically when player will respawn in new area after ‘death’.
I was trying to use Custom Event to trigger it from ‘KillTrigger’ but for some reason that I don’t understand it behave like Schrodinger’s cat: it triggered Print String but nothing else, so it works and not at the same time.
After few hours of trying to find a way how to properly cast Custom Event I gave up and I chose another approach with Booleans. The problem with logic was for auto-closing system because ‘On Component End Overlap’ also triggered closing doors ‘animation’ (it’s not really animation but asset location in X Axis is transformed by Timeline vector.
Now the system use ‘isOpen?’ Boolean to determine when doors are open and when closed. ‘On Component End Overlap’ can be triggered only when ‘isOpen?’ is True and ‘On Component Begin Overlap’ can be triggered only when it’s False – basic logic. When doors are opened and ‘isOpen?’ is set to true then auot-close animation can be triggered but after the requirement is fulfilled it sets ‘isOpen?’ to False so player can’t trigger closing animation by going away.
But when player will go away earlier before auto-close animation will trigger (3 seconds after doors are opened) then ‘isOpen?’ is set to False so auto-closing animation can’t be triggered anymore.
This is the script for Doors BP: