In this week's devlog, I cover how I created and implemented the logic for a Weeping Angel / SCP-173 style creature that only moves when the player isn't looking at it. There's a lot of different ways you could script the interaction, but for an Unreal 5.3 blueprints project like mine, I settled on a combination of line traces, custom enumerations for the player's eye state (open, closed, or squinting), and the useful (but not entirely reliable) WasComponentRecentlyRendered node.
Here are the steps as an easy digestible list!
Array Modifier in Blender
To create the creepy multi-armed creature, use an array modifier parented to an empty in Blender on an arm mesh ripped from a free base mesh found online.
Creature Blueprint Setup in Unreal
Import the FBX exported from Blender into a new blueprint making sure to have all static mesh components as children of a single parent scene component for easier rotation later.
Checking the Player’s Line of Sight
Create a custom function that returns multiple booleans about whether the creature can see the player and vice versa. Use line traces in combination with a WasComponentRecentlyRendered node to check for on-screen visibility.
Setting a Rotation Goal for the Creature
If the creature isn't visible, set a new rotation goal rotator and have the creature's parent scene component use an RInterpTo node to smoothly rotate into place during the Tick event.
Overlap Checking with Event Dispatchers
This particular creature turns off lights it's looking towards, so use a collision capsule and a custom event dispatcher to let other actors know when it has change to look in a new direction and which actors its vision collision is overlapping.
