The Beast Blocker Drawbridge was a prefab I scripted and animated to allow the player access to higher, out of reach areas. If the player had the beast companion, the beast was instructed to beat on the column making in fall over to create a path to a higher area in the level.
A. Beast Smash – The Smash POI game object on the drawbridge detects when the beast hits the prefab. These attacks are messaged directly from the Beast animation. In this section each time the beast companion hits the Smash POI a slight delay can be configured before the graph spawns a prefab. The SmashSmallShakePrefab spawns a prefab that emits VFX, Sound as well as the screen shake and rumble.
B. Final Smash – A different thread in the graph listens for the final beast attack and allows for a delay variable.
C. Drawbridge Animation – The thread continues by triggering the drawbridge fall animation.
D. Navigation Update – An invisible navigation carve over the area where the drawbridge falls is toggled off. This is to allow the companion to follow the player up the drawbridge using the navigation layer. By default both the drawbridge is in the down position and the navigation carve off which allows the navigation layer to be built properly. Only when the player enters the scene where the drawbridge is located does the drawbridge animate upright and the navigation carve get toggled on (see more below).
E. Persistence – Assuming that the drawbridge is set to persist, a persistent variable is saved to avoid the drawbridge from resetting on return visits.
F. Trigger External Events – The Smash POI detects when all beast attack animations are complete. At this point the designer can trigger additional events such as sending a message or toggling other game objects on/off.
G. Graph Enable – When the player enters the scene the graph is enabled. This thread allows the graph to check for the persistence checkbox and process the drawbridge state accordingly.
H. Check Persistence Value – If the drawbridge is set to persist the persistence value on the drawbridge is checked.
I. Smash POI Off – When drawbridge persistence is True the Smash POI is toggled off which prevents the player from seeing the attack option on the drawbridge.
J. Drawbridge Up – If the drawbridge is not set to persist or the persistence value is False, the drawbridge animation is set in the upright position.
K. Navigation Carve – Depending on the persistence setting and/or the persistence value the navigation carve is set to be toggled on or off.