Ashen Wing shared how they built a procedural tentacle system in Godot, using IK and raycasting.
Indie developer
Ashen Wing shared a custom walk cycle they made for a Stalker-type enemy in their
upcoming horror game It Breathes.
Instead of using its legs, the creature moves by pulling itself forward with tentacles growing from its back, attaching to walls and ceilings as it moves.
The main body uses regular animation, but the tentacles were done differently. Each one is built as a simple rig with around 12 to 15 bones in a chain, and with a target node at the tip that works with Godot 4’s IK system.
Moving that target controls the end of the tentacle, while the rest of the bones follow.
To decide where the tentacle attaches, the system uses a RayCast3D. When it detects a surface, it stores that position and moves the target node there. That position is updated every frame so the tentacle stays in place even while the character is moving.
The movement itself is controlled with two states. When the tentacle is looking for a surface, it extends outward. Once it finds a valid point, it switches state and stays attached.
While attached, it keeps checking the distance between the base and the tip. If that distance goes beyond a certain limit, the tentacle is pulled back.
This pullback is currently done using a lerp, followed by a short cooldown before the next extension.
Before settling on this solution, Ashen tried a different approach: generating the tentacle along a Path3D with a mesh updating in real time.
While this worked at first, it didn’t handle movement very well, as soon as the character moved, the path would shift and cause visible jitter, since the node isn’t designed for that kind of use.
If you want to see more from Ashen Wing or their game, take a look at the links below.
Interested in learning more?
If you’re interested in
the technical side of Unity, the
Unity Shaders Pro Bundle brings together three books covering shader fundamentals, procedural shapes, and compute shaders.